Qlik Community

Ask a Question

New to Qlik Sense

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

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
dreweezy
Partner
Partner

using the variable buttons to render one chart for multiple measures

I've got a situation where I've got a few buttons listed as :  Team A, Team B, Team C, etc. defined respectively as 1, 2, 3, etc in my variable list.

I would like for this histogram to render the sales based on these teams and I have my syntax as follow.

=if(($(vTeam)= 1, [Days in Team A]), if($(vTeam) = 2, [Days in Team B]),  if($(vTeam) = 3, [Days in Team C]))

I have done it this syntax by just one team and it works fine. Once I incorporate the other 3 if statements to render the chart it doesn't read it properly. Can someone please guide me on what I am doing incorrectly here. Thank you.

Labels (3)
1 Solution

Accepted Solutions
rubenmarin

Hi, parenthesys are closing if, the nest ifs you can use the second parameter of If(): If(condition, true, false)
=if($(vTeam)= 1, [Days in Team A], if($(vTeam) = 2, [Days in Team B], if($(vTeam) = 3, [Days in Team C])))

Also you can use Pick():
Pick($(vTeam)
,[Days in Team A]
,[Days in Team B]
,[Days in Team C]
)

View solution in original post

2 Replies
rubenmarin

Hi, parenthesys are closing if, the nest ifs you can use the second parameter of If(): If(condition, true, false)
=if($(vTeam)= 1, [Days in Team A], if($(vTeam) = 2, [Days in Team B], if($(vTeam) = 3, [Days in Team C])))

Also you can use Pick():
Pick($(vTeam)
,[Days in Team A]
,[Days in Team B]
,[Days in Team C]
)

View solution in original post

dreweezy
Partner
Partner
Author

Awesome! I was able to get the nested ifs to work as well as the solution you provided!