Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Educator-Ambassador
Educator-Ambassador

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
Educator-Ambassador
Educator-Ambassador
Author

Works - thank you

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