Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
i have a classic problem! i need to use evaluate() function in my Expression, ofcurse "This string function can not be used in chart expressions.", as stated in refrence manual.
as you can see i have calculated a string for every Month, my only dimension. But i need to evaluate the value of this string at the next column and evaluate dosn't works here!
i hope some QV genius could help me!
Best regards
Peyman
Hi,
Just put your string (with the = sign) into a variable vExpression, then in your chart expression use $(vExpression)
Should work...
Hope this helps,
Jason
Thank you for your help Jason,
but this will not work. QV evaluate Vars when are used in Expressions only one time when wants to refresh the chart. This means that variable will not recalculate for every dimension and this is exactly what i need.
Best regards
Peyman
Peyman,
I noticed that you want to create a set expression in the context of the dimension by using this kind of variable creation. As you also noticed, I believe that will not work this way, due to the constraints of expression evaluation.
This discussion might help you, I think using a pick/match combination and an expression branch per dimension value, you could achieve what you want, something like
=pick(match(Month,'Jan','Feb'),
SETEXPRESSION_JAN,
SETEXPRESSION_FEB
)
http://community.qlik.com/docs/DOC-1335
Regards,
Stefan
Hi Stefan,
thank you for help. I think this can be the solution if i could use variabels for expersions in pick command. my expression is something like :
= 'Count( {<Kalender.Datum={">=' & MonthStart( AddMonths( AddYears( MakeDate( Year(Today()) , MinString( Kalender.Monat ) ) , -1 ) , 1 ) )
& '<=' & MonthEnd( MakeDate( Year( Today() ) , MinString( Kalender.Monat ) ) )
& '"}>} TOTAL Kalender.Datum )'
I need for every month calculate a sum for past 11 month plus that month, this means for 2012,01 i have to make a some from 2011.02.01 to 2012.01.30 and so on.
It's really late 😉 and i'm going to test this tomorrow.
Best regards
Peyman
Try using an set expression with dollar sign expansion in the field modifier, something like
=pick(match(Month,'Jan','Feb'),
Count( {<Kalender.Datum={">=$(=MonthStart( AddMonths( AddYears( MakeDate( Year(Today()) , MinString( Kalender.Monat ) ) , -1 ) , 1 ) ))<=$(=MonthEnd( MakeDate( Year( Today() ) , MinString( Kalender.Monat ) ) ))"}>} TOTAL Kalender.Datum )
,
....
)
There may be another way round this. Are you able to post your app?
QVW is really BIG and is customer data, so i', not allowed to post the real file. But i will make a sample and post it as soon as possible.
Best Regards
Peyman