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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
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.