Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Can anyone help me with the following:
In the script, I have declared two variables for a dashboard view:
let vSalesCY='Sum ({1<Sales_Cust_Class_Code-={100},D_Date.Cal_Yr={$(vFY_0)}>}Restate_USD_Net_Sales_Amt_Ext)/1000';
let vSalesLY='Sum ({1<Sales_Cust_Class_Code-={100},D_Date.Cal_Yr={$(vFY_1)}>}Restate_USD_Net_Sales_Amt_Ext)/1000';
I use them in a chart (table) which works fine as =$(vSalesCY)
I want to add the difference in a 3rd column by dividing the two:
=S(vSalesCY) / S(vSalesLY
(I can add, substract, multiply the two variables, but not divide...
It gives me an incorrect result; can I not so something like this?
(I did also try =$((S(vSalesCY) / S(vSalesLY))
Thanks Hans
The problem is caused by the division that happens within the calculations stored in variables. When the two formulas are divided by each other, the division signs get mixed up.
The easiest and the most universal solution is to enclose your initial formulas within the variables in another pair of parentheses:
let vSalesCY='(Sum ({1<Sales_Cust_Class_Code-={100},D_Date.Cal_Yr={$(vFY_0)}>}Restate_USD_Net_Sales_Amt_Ext)/1000)';
this way, the formula will always work, no matter what other operations are used on top.
cheers,
Oleg Troyansky
QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense
Yes!
it works fine, Oleg
Thank you very much.
Rgds
Hans