Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I calculate MAPE in Qlik Sense?

I'm not able to understand the mean part is it has to take the total no

15 Replies
Not applicable
Author

It could be anything it depends on the customer how he wants to view it. I get that we ca change the dimension to quarter,year or month to get it but can we create an if logic which according to selection would change my dimension.

sunny_talwar

Not sure how you plan to do this, but something like this should work for you:

Avg(Aggr(fabs((Sum(Sales) - Sum(Base_Forecast)))/Sum(Sales), $(=If(Condition = Something, Month, Year))))

Basically the idea is to provide the condition within the dollar sign expansion here -> $(=.....)

Not applicable
Author

Thanks Sunny,

I was able to do it in another way. I preloaded the variance as a calculated colum at the time of data load. I loaded that as a dimension and took average of it. The thing which confused me was when I load this calculated column as a measure it gives a different value as when I load it as a dimension.

Please see the attached screens and please explain me what's wrong here.

1) Calculated column

1)mape.PNG

2) Without the calculated column.

snap1.PNG

3) After adding the calculated column as dimension

snap2.PNG

4) After adding calculated column as measure. The values change again to original one

snap3.PNG

Not applicable
Author

stalwar1‌ hey did you get a chance to review this ?

sunny_talwar

I thought this was resolved already since you did it in the script?

Not applicable
Author

Yes currently this is resolved but I'm unable to understand the above behavior in qliksense. Can you please explain me what I am doing wrong?