Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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

1 Solution

Accepted Solutions
sunny_talwar

My bad... can you try this

=Count({<[Session  Name] = p($(='[' & SubField(GetCurrentSelections(), ':', 1) & ']'))>} [Session  Name])

View solution in original post

43 Replies
praveenkumar_ma
Partner - Creator
Partner - Creator

Hi Naresh ,

Try this ...

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

or

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

Mightbe helpful..

Thanks

PM

narband2778
Creator II
Creator II
Author

Not working.

praveenkumar_ma
Partner - Creator
Partner - Creator

Try this...

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

Might be Helpful..

Thanks

PM

narband2778
Creator II
Creator II
Author

Not good Praveen. i am getting the result 0.

I am using the hard coded value then I am getting the count for below expression.

=Count({<[Session  Name] = {'XYZ'}>}[Session  Name])

praveenkumar_ma
Partner - Creator
Partner - Creator

Try this or Previous

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

and in Variable Defination do you have '=' front of Defination

just for info..

this might helpful

Thanks

PM

narband2778
Creator II
Creator II
Author

yes, have '=' sign before variable.

praveenkumar_ma
Partner - Creator
Partner - Creator

Try this..

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

Regards

PM

Chanty4u
MVP
MVP

try this too

Try this..

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

narband2778
Creator II
Creator II
Author

still the same. I am getting the value '0'.

Thanks,

Naresh