Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
HariChandana
Contributor
Contributor

Qlik Sense

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.

 

Labels (3)
9 Replies
justISO
Specialist
Specialist

Hi, maybe you can provide some examples how structure of your variable looks like? It would be easier to find a solution.

HariChandana
Contributor
Contributor
Author

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

 

justISO
Specialist
Specialist

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?

HariChandana
Contributor
Contributor
Author

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?

HariChandana
Contributor
Contributor
Author

Do I need to change any syntax or something for this :count(vDimCoverage), So how do I count the field inside the variable?

justISO
Specialist
Specialist

just change vDimCoverage part to name of your field where you get correct count answer, like: count([your_fields_name_here])

HariChandana
Contributor
Contributor
Author

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.

eddie_wagt
Partner - Creator III
Partner - Creator III

Try this 

=count("$(vDimCoverage)")

HariChandana
Contributor
Contributor
Author

Thanks, it worked!