Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
bob654321
Contributor
Contributor

Set Analysis expression using multiple if statements ?

How can write this if else formula using set analysis ?

 

If label = 'A' and client = 'X' then  Sum(measurefield1)/If label = 'B and client = 'Y' then  Sum(measurefield2)

If label = 'C' and client = 'X' then  Sum(measurefield3)/If label = 'D' and client = 'X' then  Sum(measurefield4)

If label = 'E' and client = 'X' then  Sum(measurefield5)

If label = 'F' and client = 'X' then  Sum(measurefield6)

 

 

Labels (2)
4 Replies
Vegar
MVP
MVP

I think a PickMatch would be a good choice in this scenario.

Sum(Pick (Match(Label&Client,'AX','BY' ,'CX', 'DX' , 'EX') ,measurefield1, measurefield2, measurefield3, measurefield4, measurefield 5))



Plees ekskuse my Swenglish and or Norweglish spelling misstakes
bob654321
Contributor
Contributor
Author

How can I calculate the division(Sum(Measure1)/Sum(Measure2) using multiple if conditions as I mentioned in my initial post ?
qliksus
Specialist II
Specialist II

Since the alphabets match the field number in your requirement create a variable like the below

Variable1 = 'MEASURE'&( (ord('$(=FIELD)') +1)-65)

Expression : Sum( $(variable1 ))

The measure field will change based on the selection you make
bob654321
Contributor
Contributor
Author

How can I calculate the division using multiple if statements ?