Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
koushik_btech20
Contributor

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
Highlighted

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

May be try this

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

View solution in original post

10 Replies
Highlighted
stabben23
Honored Contributor

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

Hi,

use this Expression in textbox

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

Highlighted
stabben23
Honored Contributor

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

or this if you want same format:

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

Highlighted

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

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

Highlighted
stabben23
Honored Contributor

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

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

Highlighted

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

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.

Highlighted
stabben23
Honored Contributor

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

agree, aggr should be avoid if possible.

Highlighted
koushik_btech20
Contributor

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

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)))

Highlighted
stabben23
Honored Contributor

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

Hi,

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

try Without that,

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

Highlighted
koushik_btech20
Contributor

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

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