Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am new to Qlik Sense. Please help me with this.
I need to take count of values in Dynamic Variable like this: Count(Variable)
But it always gives me 1 as the answer which is wrong. The variable contains a dynamic field.
But instead of variable, when I use Count(corresponding field) , it gives me correct answer (eg 12 or 10).
But as per requirement, I need it to be dynamic ( that is as per the selection the field in the variable keeps changing), So please help me with this. How can I use count of variable? I need this ASAP.
Hi, maybe you can provide some examples how structure of your variable looks like? It would be easier to find a solution.
Hi,
The variable name is vDimCoverage, It just contains one field. and the field keeps changing as per the selection made in the dashboard.
My requirement is to count the no.of values in that variable(field). so when I give count(vDimCoverage) It always gives 1 as the answer.
I am not able to provide you the screenshots as it is prohibited. Could you please help me with this
I believe that it is correct, that count(vDimCoverage) gives you '1' as variable is always a one line string/number. But you mentioned that this variable is changing according selection, so maybe you need to count field what you are changing, not the variable itself?
Hi,
yes when I count the field I am getting the correct answer. But then, Could you give a solution how to count the field inside the variable?
Do I need to change any syntax or something for this :count(vDimCoverage), So how do I count the field inside the variable?
just change vDimCoverage part to name of your field where you get correct count answer, like: count([your_fields_name_here])
Actually the field name keeps changing as per selection right, so I will need the count as per the selection. So I cant use field name directly. I will have to use variable only. So please help me with this.
Try this
=count("$(vDimCoverage)")
Thanks, it worked!