Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT 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
Creator III
Creator III

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
Creator III
Creator III

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
Creator III
Creator III

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!