I Am trying to assign a simple formula into a variable, but i don't know how to do that in Qlik.
for example in SQL i would to this:
Sum(CostPrice-Discount) AS 'Subs'
How do i do this in Qlik Sense?
Thanks a lot
in the script you would do
LET Subs = 'sum(CostPrice-Discount)';
Set Subs = 'sum(CostPrice-Discount)';
depending on how you're intending to use it.
Thank you for your answer, but it doesn't work
Probably, because I am not trying to do that in the script, but in the 'Expression Editor'
I am trying to edit an expression and add a calculated field
Any other suggestions?
A little confused. Why wouldn't you just do Sum(CostPrice-Discount) in your expression editor? Or is discount or costprice a calculation as well?
Because it's a formula of a few variables, each of them is like 2 lines long, so i want to set each one of them to a variable. Otherwise the formula is going to be a long mass :-P