Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variables in set analysis

Hello!

I am working on a histogram bar chart. I am trying to make it so when I select a company from a filter pane the chart updates with data only from the companies with the same asset range (eg. the user selects Company A which has an asset range of 1 million - 2 million and the chart updates with data from companies who only have asset range of 1million - 2 million)

Here is what I have so far which doesn't work:

Count({1<[AssetRange]= P({1<[company]= $(vCompany) >} [AssetRange]) >}[ParticipationRate])

where I have defined vCompany = GetFieldSelections([company]). When I try to hard code the company in like this:

Count({1<[AssetRange]= P({1<[company]= {'CompanyA'} >} [AssetRange]) >}[ParticipationRate])


I get the desired result. My question is, what am I doing wrong as far as using the variable in this case. Please feel free to ask any clarifying questions, or let me know if anything is ambiguous.


Thanks in advance

1 Solution

Accepted Solutions
sunny_talwar

Yes, it puts a single quotes. Can you try this:

Count({1<[AssetRange]= p({1<[company]= p(company)>} [AssetRange])>}[ParticipationRate])

View solution in original post

5 Replies
sunny_talwar

Try this:


Set vCompany = Chr(39) & GetFieldSelections([company], Chr(39) & ',' & Chr(39)) & Chr(39)

Not applicable
Author

That puts quotes around the output of GetFieldSelections right? It didn't work but I will continue playing around with it. Thanks!

sunny_talwar

Yes, it puts a single quotes. Can you try this:

Count({1<[AssetRange]= p({1<[company]= p(company)>} [AssetRange])>}[ParticipationRate])

Not applicable
Author

Is that right? I see 2 set analysis tags being opened and 3 being closed. This is what ended up working for me based on your answer above:

Count({1<[AssetRange]= p({1<[company]= p(company)>}[AssetRange]) >}[ParticipationRate])



sunny_talwar

My bad