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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

Absolute Value

Hi,

Please find the attached qvw file.

I have used Fabs function in my vMAPE calculation. After that all the negative sign is replacing with positive sign. But the calculation is same. But if we will see the total value of the expression it is wrong. Now it is coming 0.59. As per positive calculation it should be 0.75.

In Excel there is a function abs, which is providing the same output. i.e - 0.75.

Can any one give me the same output.

Thanks.

1 Solution

Accepted Solutions
danieloberbilli
Specialist II
Specialist II

if you use sum(aggr( Fabs((Sum(SALES_QTY) - Sum(SOP_Cts))/1000), Group, CATEGORY))

it should result in

Capture.PNG.png

View solution in original post

4 Replies
danieloberbilli
Specialist II
Specialist II

if you take away the fab() function, the result is still -0.59  ...so it seems that the mistake is not due to the fab() function.

danieloberbilli
Specialist II
Specialist II

This should work:

sum(aggr( Fabs((Sum(SALES_QTY) - Sum(SOP_Cts))/1000), Group, CATEGORY))

sona_sa
Creator II
Creator II
Author

But After the calculation of  = Sum(Actual)-Sum(Plan) whatever the figure is coming, Positive or Negative --> I want to convert in Positive and then Total of all the value. i.e is 0.75.

danieloberbilli
Specialist II
Specialist II

if you use sum(aggr( Fabs((Sum(SALES_QTY) - Sum(SOP_Cts))/1000), Group, CATEGORY))

it should result in

Capture.PNG.png