I think in Lens it may be possible to do something.
Maybe this is a long stretch of the Lens Formula
feature, while waiting for the conditionals support in it, you can model the problem this way:
ifOverThousandOutputOne( overall_sum(count()) ) * overall_sum(count())
The ifOverThousandOutputOne
is an hypothetical function we can model this way:
- if the
overall_sum(count())
minus X (in your case 1000) is above 0 output 1
- otherwise output 0
One way to model this hypothetical function is to use the clamp
math function:
clamp( overall_sum(count()) - 1000, 0, 1)
The clamp
function will return a value between 0 or 1 in this case, but what it is used here is to return 0 for all those values below 1000 ( 5 - 1000 = -995 which be clamped to 0
). If you have values between 0 and 1 there are still some tricks available, but if you working with count()
do not worry that they are all integers.
At this point the full formula can be:
clamp( overall_sum(count()) - 1000, 0, 1) * overall_sum(count())
Some examples here for overall_sum(count())
as 5 and 2000:
clamp((5 - 1000), 0, 1) * 5 => 0
clamp((2000 - 1000), 0, 1) * 2000 => 2000
Of course you can replace overall_sum(count())
with any other function you like.
The resulting chart will be a little bit misleading in case of <1000, but a good title may mitigate that - as all slices will have a 0 size:
Would that help?