Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
narband2778
Creator II
Creator II

Trying to use a variable In Set Analysis

Hello Everyone,

I have created a Variable in the Variables

vCurrentSelection =SubField(GetCurrentSelections(), ':',2)

and now I am trying to use the variable in Set analysis, but it is not working

=Count({<[Session  Name] = {"$(=vCurrentSelection)"}>}[Session  Name])

Can someone help me with this.

thanks in advance.

Naresh

43 Replies
narband2778
Creator II
Creator II
Author

nope

Neymar_Jr
Creator II
Creator II

May be this -

Count({<[Session  Name] = {$(=$(vCurrentSelection))}>}[Session  Name])


Thanks,

RT

narband2778
Creator II
Creator II
Author

nope.

Thanks,
naresh

narband2778
Creator II
Creator II
Author

Hi Chanty,


instead of using as variable Can I use Subfield function in set analysis in Qlik Sense

=Count({$<[Session Name] = {"$(=SubField(GetCurrentSelections(), ':', 2))"}>}[Session Name])

Thanks,

Naresh

Neymar_Jr
Creator II
Creator II

Remove the '=' sign you used while declaring variable

or

May be share a sample app?

Thanks,

RT

praveenkumar_ma
Partner - Creator
Partner - Creator

Try this

=Count({<[Session  Name] = {"$(vCurrentSelection)"}>}[Session  Name])

and Remove the '=' in variable Defination.

Might helpful..

Thanks

PM

narband2778
Creator II
Creator II
Author

no Luck mate. Still I am getting 0.

sunny_talwar

If I may ask, what exactly are you trying to parse out from GetCurrentSelections? Which field's value are you trying to compare to Session Name?

Chanty4u
MVP
MVP

what is result you want to see?

because  the result of your variable is 

value1,Value2,value3  

after that if you count it will show 1 i think. ?  correct me if im wrong?

narband2778
Creator II
Creator II
Author

Hi Sunny,

basically I got 15 fields  like [Operating name], [Session Name] and so on.

I need to count how many times a selected value will appear in all those 15 Fields.

For Example, 'XYZ' is a value in [Operating Name] and this value might be available  in remaining 14 other fields. So, I want to count 'XYZ' Value in all 15 fields.

I hope my requirement is explained clearly. Let me know, if this doesn't help.

thanks in advance.

Naresh