Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all.
Is there anyone that could explain how I could set av varibale in my load script (SET Current_FC = BudgetType=('FC2 2013');) and then use the variable in a set analysis like:
sum({$<PeriodCounter={"$(#=max(PeriodCounter-1))"}, $(Current_FC) ,Cost_Center_ID-={'10600'}>} BudgetAmount) *-1/1000
Thanks in advance!
have you tried just SET Current_FC = 'FC2 2013';
because with {'FC2 2013'} you have double brackets BudgetType={{'FC2 2013'}}
or try
SET Current_FC = FC2 2013;
and then BudgetType={'$(Current_FC)'}>
Hi,
maybe this post could help you Setting a variable in script...
May this http://community.qlik.com/blogs/qlikviewdesignblog/2013/11/18/dollar-expansions can solve your problem
Thanks for reply. Unfortunately I did'nt find anything that solve my problem...
Thanks for reply. Unfortunately I did'nt find anything that solve my problem...
I would change a little the sentence for setting the variable:
SET Current_FC = BudgetType={'FC2 2013'}
Use curly brackets. In fact your variable should contain a true part of the set analysis syntax
Perhaps, also, use quotes: set Current_FC = "xxxx"; (due to the = sign in your text also)
Fabrice
Hi,
Check this,
http://community.qlik.com/message/357969#357969
http://community.qlik.com/message/370872#370872
Regards,
Ravikant
Yes, I get the right value (BudgetType={'FC2 2013'}) for the variable if I look in the Variable Overview...
But i don't get the calculation right the I have the expression like this:
sum({$<PeriodCounter={"$(#=max(PeriodCounter-1))"}, BudgetType={$(Current_FC)} ,Cost_Center_ID-={'10600'}>} BudgetAmount) *-1/1000
Any suggestions?
It seems correct. I would try to enclose the variable between quotes or brackets because there is a space (special character):
BudgetType = {[$(Current_FC)] }
Fabrice
Thanks for reply! But it still doesn't work, I only get 0. Do you have any other suggestions?