I have a new challenge !
For one project based on exchange rate, I have created 100 variable like this :
In loading script :
load distinct Currency Resident ExchangeRates;
LET vRows = NoOfRows('Currency_Table_tmp');
FOR i = 0 to $(vRows)-1
LET vCurrency = Peek('Currency',$(i),'Currency_Table_tmp');
if(len('$(vCurrency)') > 0) then
Set $(vCurrency)_TO_GBP = 1;
Set $(vCurrency)_TO_EUR = 1;
One example for a currency AUD:
Variable created : AUD_TO_GBP & AUD_TO_EUR
User can change the rate manually inside the application, that's why I need to create all variables
Now, I'm trying to use dynamically the variable into a table :
My goal is to get that :
Currency (dimension) / Sales GBP (expression) / Sales Euro (expression)
AUD / sum(Local Sales) * AUD_TO_GBP / sum(Sales) * AUD_TO_Euro
Don't forget AUD_TO_GBP is a variable and not a column.
I have tried to do that
=sum(Local Sales) * $('=only(Currency') & '_TO_EUR')
But Qlikview doesn't understand this :
$('=only(Currency') & '_TO_EUR') => the goal is to have the value of this variable (AUD_TO_EUR) and it depends on the currency name in my table
Any idea ?