Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shekhar_analyti
Specialist
Specialist

Set expression Based on selection of multibox where a particular value should move to specific variable

Hi All ,

I have a scenario where in a Multibox I have four country , France , Germany , UK , US .

Multibox.JPG

Below is a set expression

Sum({<Value=varible1,Field1={xyz}>}Sale)+
Sum({<Value=varible2>},Field2={xyz}Sale)+
Sum({<Value=varible3>},Field3={xyz},Sale)+
Sum({<Value=varible4>},Field4={xyz},Sale)

My Requirement :

SCENARIO 1 : Single Select

if User selects France from Multibox then , France should go to variable 1 and return me value , but at same time set expression containing other variables should force return me 0

if user selects Germany then , Germany should go go to variable 2 and return me value , but at same time set expression containing other variables should force return me 0

SCENARIO 2 : Multiple Select

if User selects France and Germany from Multibox then France should go to variable 1 and Germany should go go to variable 2 and return me their sum , but at same time set expression containing other variables 3 and 4 should force return me 0

If user selects all four countries then variable  1 should take France , variable 2 should take Germany , variable 3 should take UK , 4 US

if user select France and UK then 1 should take France and variable 3 should take UK  while expression with variable 2 and 4 should return forced 0

Based of selection in multibox values should move to respective variable .

17 Replies
sunny_talwar

By sample I meant a qvw brother.... I want to see the setup of your variable and your expression...etc

shekhar_analyti
Specialist
Specialist
Author

March30.JPG

my req :

When from multibox having ID nothing is selected then ,

sum of sale of ID1 where Field1 is not null  and less than 200 + sum of sale of ID2 where Field 2 less than 30 and not null +

sum of sale of ID3 where Filed 3 is less than 50 and not null .

if anything is selected than their sum of sale excluding null from respective field

Answer to this will probably help me .

shekhar_analyti
Specialist
Specialist
Author

Please find sample qvw

sunny_talwar

I don't see anything attached

shekhar_analyti
Specialist
Specialist
Author

I am sorry bare bhai .. I was onto so many thing

sunny_talwar

Like this

=Count({<Field2 = {'<200'}, ID *= {'ID1'}>+<Field2 = {'<30'}, ID *= {'ID2'}>+<Field2 = {'<50'}, ID *= {'ID3'}>}ID)

Capture.PNG

shekhar_analyti
Specialist
Specialist
Author

Thanks Sunny Bhai . I was able to solve my issue . Actually I was moving in wrong direction .. in short ... I was  thinking too much .. it was more like trying to cut an apple with sword .

sunny_talwar

Great, please close the thread by marking the correct response

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny