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: 
koushik_btech20
Creator
Creator

Straight table sum of Rows value of Expression in a text object

Hi Everyone,

I have a demo data and app where I have Actual and Budget data. I need the last expression total (sum of Rows) value in a textobject. Is it possible through expression label or any if other way out is there ?

Regards,

Koushik

1 Solution

Accepted Solutions
sunny_talwar

May be try this

Sum(Aggr(fabs($(expr_Actual)-$(expr_Budget)), $(='[' & GetCurrentField(TimeDim) & ']')))

View solution in original post

10 Replies
stabben23
Partner - Master
Partner - Master

Hi,

use this Expression in textbox

=sum(aggr(fabs(sum(Actual)-sum(Budget)),Date))

stabben23
Partner - Master
Partner - Master

or this if you want same format:

num(sum(aggr(fabs(sum(Actual)-sum(Budget)),Date)),'#,##0')

sunny_talwar

This might work also, if you have one value per day for Actual and Budget

=Sum(Fabs(Actual - Budget))

If not, then go with stabben23‌'s solution

stabben23
Partner - Master
Partner - Master

It does stalwar1, and its of course a better solution than mine.

sunny_talwar

Well this might just be some mocked up data and it might not work in real scenario. But ya def worth checking because it would be a good idea to avoid Aggr() if we can.

stabben23
Partner - Master
Partner - Master

agree, aggr should be avoid if possible.

koushik_btech20
Creator
Creator
Author

Based on Steffan solution I was trying to resolve but getting 0 where in dimension I am using TimeDim cyclic group and actual and budget this two expressions I am storing in a variable which I am referring.

I am using below expression,


sum(aggr(fabs($(expr_Actual)-$(expr_Budget)),GetCurrentField(TimeDim)))

stabben23
Partner - Master
Partner - Master

Hi,

I dont know why you are using GetCurrentField in a textbox?

try Without that,

or Sum(Fabs($(expr_Actual)-$(expr_Budget)))

koushik_btech20
Creator
Creator
Author

It's  throwing an error as nested aggregation not allowed.