Discussion Board for collaboration related to Creating Analytics for QlikView.
I want to set a variable (FC) either to be a factor ("*1.3") or a summand ("+0.3"). This variable shall then be used as a function on the field "price":
In Matlab this would work. or in excel it would be:
But how can I do this in QlikView?
Go to Solution.
Thank you Bapperson! Looks good, but as you metnion, the variable is used in an expression and is dynamically alteredd by the user, so the scripted solution won't work. :-S
My way around the problem:
I just defined two variables: FC_factor and FC_summand, so that I defined the expression as
Although this did not solve the original question it provided a solution by circumventing the problem.
Apparently the evaluate function in QlikView only works at the script level.
In the script as an example I did:
LOAD * INLINE
set FC = "*1.3";
set FC2 = "+0.3";
Evaluate(Price $(FC)) as FCPriceCalculated,
Evaluate(Price $(FC2)) as FC2PriceCalculated
Drop table Table1;
This calculates based on your variables into the new fields.
If you try and use evaluate at the expression level or in a variable it will not work... :/
I have attached a working qvw for your reference as well.
Hope this helps!