Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
When I copied this expression into a text box, I see Error: Error in expression: ')' expected.
=IF(($(vForecastRound)=0 and $(vActualRound)=0), IsNull(Null()), IF(FABS($(vNewVariance))>1,0, 1-FABS($(vNewVariance))))
I think the issue is related to FABS($(vNewVariance)) because this alone gives me the same error. Does FABS() not work in this case for some reason?
Thanks,
Cassandra
Put an equal sign in the beginning of the variable for vNewVariance
=IF($(vVariance)=0,0,IF($(vForecastRound)=0,IF($(vVariance)<0,-1,1), ($(vVariance)/ ($(vForecastRound))))).
Sounds silly but should work!
Do this for all of your variables. From your sample it seems thats the issue. Let me know if it works.
Hi,
I added "=" in vNewVariance variable. Can you check if it is producing the expected results.
As pointed out to me by an earlier response, having the = causes issues such as:
https://community.qlik.com/message/931044?et=watches.email.thread#931044
See above.
I needed to test the below approach and it seems to be working so you need this FABS($(=$(=vNewVariance))). The calculated variable needs to be calculated as well.:
Hope this helps.
Thanks
Sinan,
Thanks for the help but I am still a little confused. The original issue was that my Forecast Accuracy was not displaying. The expression in the chart is =$(vNewForecastAccuracy) and the variable expression is =IF(($(vForecastRound)=0 and $(vActualRound)=0),IsNull(Null()),IF(FABS($(vNewVariance))>1,0,1-FABS(($(vNewVariance))))) . Even if I update this to =IF(($(vForecastRound)=0 and $(vActualRound)=0),IsNull(Null()),IF(FABS($(=$(=vNewVariance)))>1,0,1-FABS($(=$(=vNewVariance))))) , it doesn't look right.
What am I missing?
The vNewVariance expression is defined as IF($(vVariance)=0,0,IF($(vForecastRound)=0,IF($(vVariance)<0,-1,1), ($(vVariance)/ ($(vForecastRound))))) .
Thanks,
Cassandra
This is the expression in the forecast accuracy column:
Is the expression correct? It seems like the columns are not available any longer.
No, I was playing with that expression to try to get it to work. It is normally populated with =$(vNewForecastAccuracy)
The general problem you are dealing with is the comments in your variables. The comments will get included in the expansion. So for example:
myvar = 1+1 // comment
=fabs($(myvar))
expands to:
=fabs(1+1) // comment)
Notice the right paren for fabs() is now after the comment -- a syntax error. Remove the comments from your variable defs and it will work.
How do I debug this? Remove the label from the Forecast Accuracy Expression. Now the column heading shows the expanded expression, and you can examine the full syntax.
-Rob