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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III
Creator III

Create Variable - IF Statement - other method?

Hi -

Seems like a simple question but I might be overlooking something.

I am creating the following variable:

vProfit

My expression is :

=IF(ProductProfitID=1,2.5,IF(ProductProfitID=2,3.25,4))

Is there another method / function I can do in which assign a value to the vProfit based upon the ProductProfitID

(ProductProfitID can be 1,2,3 or 4) ?

 

- Jerry

1 Solution

Accepted Solutions
rubenmarin

Hi @jerryr125, you can also use Pick():

Pick(ProductProfitID
  ,2.5
  ,3.25
  ,//value for 3
  ,//value for 4
)

View solution in original post

2 Replies
rubenmarin

Hi @jerryr125, you can also use Pick():

Pick(ProductProfitID
  ,2.5
  ,3.25
  ,//value for 3
  ,//value for 4
)
jerryr125
Creator III
Creator III
Author

Works - thank you

NUM#(PICK(ProductProfitID,45,25,35,80),'#0.00')