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: 
dreweezy
Partner - Creator II
Partner - Creator II

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 (2)
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]
)
dreweezy
Partner - Creator II
Partner - Creator II
Author

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