Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Same expression but different result

Hi all,

I have a combo chart that displays data for a variable:

vNewForecastAccuracy 

  IF(($(vForecastRound)=0 and $(vActualRound)=0),0,IF(FABS($(vNewVariance))>1,0,1-FABS(($(vNewVariance)))))

  forecast_accuracy.gif

I wasn't sure why Q4 was showing 0 so I pulled it into a table and the other three Qs match but Q4 shows 2.1%.

forecast_accuracy_dev.gif

The charts have the same exact expression so why would these be different? It's almost as if the "if statement" (IF(FABS($(vNewVariance))>1,0,1-FABS(($(vNewVariance)) is applying to the first chart but not to the second and I cannot figure out why.

 

vNewVariance

 

IF($(vVariance)=0,0,IF($(vForecastRound)=0,IF($(vVariance)<0,-1,1), ($(vVariance)/ ($(vForecastRound)))))

 

Any help would be appreciated.

Thanks,

Cassandra

6 Replies
alexpanjhc
Specialist
Specialist

to me, i think this is correct.

for 16Q4

your FABS($(vNewVariance)) is actually greater than 1, for that reason, your forecast actual should be 0. ---your vNewVariance seems to be the Variance%, correct?

sunny_talwar

Would you be able to share a sample of what you have?

cbaqir
Specialist II
Specialist II
Author

But why would it be a different result in two different places?

swuehl
MVP
MVP

Are you sure you are operating on the same record set (including active selections made) and are using the same dimension and expression in both charts?

alexpanjhc
Specialist
Specialist

Try 2 tests

1)  put the variance% in the second chart see the result

2) remove the variance% from the second chart and create a text object and use the vNewVariance formula there  and see result?

Anonymous
Not applicable

We can better assist you if we have any sample app.