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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
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

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Put this expression and try:

=Sum(Aggr(fabs(sum({<ACNT_FLEX_02={'Balance Sheet'}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)),ACNT_FLEX_01,ACNT_FLEX_03))

View solution in original post

23 Replies
maxgro
MVP
MVP

where do you want the fabs?

fabs(sum....)

or

sum( ....fabs(TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1))

?

awhitfield
Partner - Champion
Partner - Champion

HI Arul,

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

Fabs and sum are the wrong way round!

HTH Andy

tresesco
MVP
MVP

Try like:

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

prajapatiamar38
Creator II
Creator II

Hiii..

Try like this


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


I hope it will work



Thanks

Not applicable

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

arulsettu
Master III
Master III
Author

it showing error

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

arulsettu
Master III
Master III
Author

it showing correct total. but the value changed

Colin-Albert
Partner - Champion
Partner - Champion

Your expression is calculating the sum of the column and then using fabs() to show the absolute value after summing the records.

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

If you want to calculate the absolute value of each record before summing the result, then you need to include

the fabs() function inside the sum.

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

tresesco
MVP
MVP

Fabs() is not an aggregation function, hence it shows error with set analysis expression in it. Try the way I showed above.