Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
paul_ripley
Creator III
Creator III

AGGR and SUM

Hello

I have a chart and the dimension is called consol_Rep_line.  The rows do do not add up to the subtotals.  For example Employee costs should be 11,007,461

I was wondering if it was possible to AGGR and SUM to round the rows

This is the expression below.  I have tried to add AGGR(sum( but it didnt work.  Should this work?

Thanks

Paul

 
 
 

=if(consol_Rep_Type='H',' ',


//AGGR(sum(

sum(


{$<period = {">=$(vStartPeriod_CY)<=$(vEndPeriod_CY)"},
bud2 = {">0"},
team -= {300,200,850,860,220,830,820},
busarea = {IN},
Datasource = {'Actual'}
>} $(vCurrency))


)
// ,
//
//consol_Rep_line))

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

See if this works

=Sum(Aggr(
If(consol_Rep_Type = 'H',' ',
Sum({$<period = {">=$(vStartPeriod_CY)<=$(vEndPeriod_CY)"},
       bud2 = {">0"},
       team -= {300,200,850,860,220,830,820},
       busarea = {IN},
       Datasource = {'Actual'}
>} $(vCurrency))
)
, consol_Rep_line))

View solution in original post

6 Replies
sunny_talwar

The correct order is Sum(Aggr()) instead of Aggr(Sum())

paul_ripley
Creator III
Creator III
Author

Thanks Sunny.  I have changed but again the below doesnt work

Do you have any ideas?

 

Sum(Aggr(


sum(
{$<period = {">=$(vStartPeriod_CY)<=$(vEndPeriod_CY)"},
bud2 = {">0"},
team -= {300,200,850,860,220,830,820},
busarea = {IN},
Datasource = {'Actual'}
>} $(vCurrency))
)

,consol_Rep_line))

sunny_talwar

If statement is not needed anymore? I am confused?

paul_ripley
Creator III
Creator III
Author

sorry i didnt include that

 

=if(consol_Rep_Type='H',' ',


Sum(Aggr(


sum(
{$<period = {">=$(vStartPeriod_CY)<=$(vEndPeriod_CY)"},
bud2 = {">0"},
team -= {300,200,850,860,220,830,820},
busarea = {IN},
Datasource = {'Actual'}
>} $(vCurrency))
)

,consol_Rep_line))

sunny_talwar

See if this works

=Sum(Aggr(
If(consol_Rep_Type = 'H',' ',
Sum({$<period = {">=$(vStartPeriod_CY)<=$(vEndPeriod_CY)"},
       bud2 = {">0"},
       team -= {300,200,850,860,220,830,820},
       busarea = {IN},
       Datasource = {'Actual'}
>} $(vCurrency))
)
, consol_Rep_line))
paul_ripley
Creator III
Creator III
Author

Thanks Sunny - that worked

Kind regards

Paul