Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

IF Statement

Hi,

I have the following variables:

I would like to create an expression in a straight table that says something like the following:

If Group=Fuel Oil then vFuelOil*(an expression I have created) or

If Group=Gasoline then vGasoline*(same expression as the above) or

If Group=MidDist then vMidDist*(same expression as the above)

else 0

Is the above possible?

Thanks,

Daniel

1 Solution

Accepted Solutions
Anonymous
Not applicable

if(Group = 'Fuel', vFuelOil * [expression],

  if(Group = 'Gasoline', vGasoline * [expression],

  if(Group = 'MidDist', vMidDist * [expression])))

View solution in original post

5 Replies
Anil_Babu_Samineni

Yes, I think we can.  but,  Can we have the expression

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable

if(Group = 'Fuel', vFuelOil * [expression],

  if(Group = 'Gasoline', vGasoline * [expression],

  if(Group = 'MidDist', vMidDist * [expression])))

varshavig12
Specialist
Specialist

=if(Group = 'Fuel', vFuelOil * [expression],

  if(Group = 'Gasoline', vGasoline * [expression],

  if(Group = 'MidDist', vMidDist * [expression]   ,0    )))

danielnevitt
Creator
Creator
Author

Marcio/Varsha,

Thank you both for your help.

Regards,

Daniel

sunny_talwar

Just as a way for slight improvement, you can use Pick(Match()) here

Pick(Match(Group, 'Fuel' , 'Gasoline', 'MidDist'),

vFuelOil ,

vGasoline,

vMidDist) * expression