Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all, I have a QV application with a lot of expressions. Now I want to use variables to store this expressions in, so i can reuse them. You can do this in the variable overview and in the script editor. The first option works fine but in the last one i run in to a problem. For Example, I have the next formula;
Avg ({<Fact= {'X'},[Fiscal period]={$(=[PIT period])},[Fiscal year]={$(=[PIT year])}>}(Data)))/100
when I put this one in the script;
Set vExpr4Actual = (Avg ({<Fact= {'X'},[Fiscal period]={$(=[PIT period])},[Fiscal year]={$(=[PIT year])}>}(Data)))/100;
When I run it, the formule doesn't work anymore and looks like this in the variable overview
(Avg ({<Fact= {'X'},[Fiscal period]={(internal error)},[Fiscal year]={(internal error)}>}(Data)))/100
It seems that the script engine wants to interpret the variables, can anyone help me out here?
Thanks in advance!
Hi,
one workaorund which I found on this site and worked for me was to replace the "$" with it's ASCII equivalent.
so try something like this:
let vExpr4Actual='(Avg ({<Fact= {'X'},[Fiscal period]={' & chr(36) & '
(=[PIT period])},[Fiscal year]={' & chr(36) & '(=[PIT year])}>}(Data)))/100';[Rob Wunderlich has a post on his blog putting the question of escape characters high on his wishlist for new things from qlikview to avoid this kind of messy construction]
hope this helps
Hi,
one workaorund which I found on this site and worked for me was to replace the "$" with it's ASCII equivalent.
so try something like this:
let vExpr4Actual='(Avg ({<Fact= {'X'},[Fiscal period]={' & chr(36) & '
(=[PIT period])},[Fiscal year]={' & chr(36) & '(=[PIT year])}>}(Data)))/100';[Rob Wunderlich has a post on his blog putting the question of escape characters high on his wishlist for new things from qlikview to avoid this kind of messy construction]
hope this helps
Hi,
Use "Let" keyword instead of "Set".
I hope this will solve your problem
Regards,
Kaushik Solanki
Let wil try to evaluate the expresion, so that isn't a solution
This answer seems to solve the problem, only i have to rewrite all the formula's.