Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating an expression based on a variable

Hi Gurus,

I'm new into the QlikView world, so I need some help. I want to create into a straight table a new expression like this one

case when CR_COD_CURRENCY_SAP = 'EUR' then Act Price Material EUR
when CR_COD_CURRENCY_SAP = 'USD' then Act Price Material USD
when CR_COD_CURRENCY_SAP = 'LOCAL' then Act Price Material LOCAL
END

where CR_COD_CURRENCY_SAP is a dimension and Act Price Material EUR, Act Price Material USD, Act Price Material LOCAL are variables.
How can I translate this into QV language?

Thank you in advance,
Cristina

2 Replies
swuehl
MVP
MVP

Maybe like

=pick(

match(CR_COD_CURRENCY_SAP, 'EUR', 'USD', 'LOCAL'),

ActPriceMaterialEUR,

ActPriceMaterialUSD,

ActPriceMaterialLOCAL

)

Not applicable
Author

Thank you for your quickly reply, but the syntax is not correct. I modified it like this in order to get Expression OK:

pick(
match(CR_COD_CURRENCY_SAP, 'EUR', 'USD', 'LOCAL'),
$(Act Price Material EUR),
$(Act Price Material USD),
$(Act Price Material Local))

  but it doesn't work, the column is empty.