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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
arulsettu
Master III
Master III

Fabs function giving wrong total

hi i am trying to show negative values to positive

so did like this

=fabs(sum({<ACNT_FLEX_02={'Balance Sheet'}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1))

but my sub total is wrong any one tell me why?

Thanks

23 Replies
arulsettu
Master III
Master III
Author

Colin Sum(fabs(...

gives error

Colin-Albert
Partner - Champion
Partner - Champion

I updated the expression to
sum({<ACNT_FLEX_02={'Balance Sheet'}>} fabs(TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1) )

arulsettu
Master III
Master III
Author

Hi Tresesco,

                yours works fine. total is correct but shows incorrect value why?

tresesco
MVP
MVP

Yes, that would change the value, if you want the absolute value of the sum, try like:

Sum(Aggr(Fabs(sum({<ACNT_FLEX_02={'Balance Sheet'}>} TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)), Dimension1, dimension2...))

Colin-Albert
Partner - Champion
Partner - Champion

I just notice the minus sign between the two fields, Adding spaces makes the expressions easier to read,

Try this

fabs(

     sum({<ACNT_FLEX_02={'Balance Sheet'}>}TBAL_MTD_DR_LC_1)

     -

     sum({<ACNT_FLEX_02={'Balance Sheet'}>}TBAL_MTD_CR_LC_1)

)

or

fabs( sum({<ACNT_FLEX_02={'Balance Sheet'}>}TBAL_MTD_DR_LC_1))

-

fabs( sum({<ACNT_FLEX_02={'Balance Sheet'}>}TBAL_MTD_CR_LC_1))

arulsettu
Master III
Master III
Author

Incorrect subtotal colin

Colin-Albert
Partner - Champion
Partner - Champion

Can you post some example data and the subtotal you are expecting to see?

tresesco
MVP
MVP

Did you check the 2nd expression i suggested above?

arulsettu
Master III
Master III
Author

this one

Sum(Aggr(Fabs(sum({<ACNT_FLEX_02={'Balance Sheet'}>} TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)), Dimension1, dimension2...))


i replaced two dimesions in my chart above expression but incorrect value

arulsettu
Master III
Master III
Author

plz some one check my sample app