Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm writing a report in which I calculate the average of a survey question where users could enter values from 0-10. To do this, I'll calculating the Sum of all their responses and dividing by the count for a given grouping
num
(
Sum(Group2Response)
/
count(distinct [ID])
,'##.00'
)
I need to do a limitation on the dimension, but not on the value itself. I need the limitation to be on the specific number of survey responses going into that average, removing those bars with <10 respondents. So if there are only 5 people that listed "Other" for Gender, I need to remove their bar from the graph, in order to protect the anonymity of the survey. There are numerous filters, so by filtering and getting a small sample size, it could be possible to figure out who gave certain responses.
However, I can't figure out how to do a dimension limitation that specifically only does the sum for the individual bar. For example, this is what I'm using for the expression of the limitation.
num
(
Sum(Group2Response)
/
vSampleMinimum
,'##.00'
)
But the Sum(Group2Response) is doing the sum for all the survey results, not for the specific dimension values (i.e. it's not calculation just the sum for "Male" respondents, "Female" respondents, etc.).
How do I make it so that this sum will only calculate for the individual bar? I've tried adding in various expressions with <> and {} that I've seen online to do some "set analysis," but I'm new to qliksense and don't quite understand it. And I'm not sure it's even possible to do with the dimension limitation section.
Hi, can you try adding the contion to the expression, like:
If(count(distinct [ID])>10, num(Sum(Group2Response)/count(distinct [ID]),'##.00'))
Or maybe with a aulated dimension like:
Aggr(If(count(distinct [ID])>10,DimensionFieldName),DimensionFieldName)
There is a feature suggestion in the ideation platform to choose which measure to use as calculation basis using dimension limitation. You can vote for this issue to push it in the roadmap.
https://ideation.qlik.com/app/#/case/274396?currentProductId=9da99bc1-0dfb-4471-8e12-d23685578c43&se...
BR,
Rumen