Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
n1ef5ng1
Creator
Creator

aggr

Hi gurus,

I know the only solution to solve my problem is to use aggr, but I have not use aggr before and have no idea on how to make it works

TypeNumber of PeopleVacation Stay in DaysTotal Days(Column(2) * Column(3))
Male4520
Male414
Male51260
Male339
Male7214

The sum of Total Day will be 107 after adding up the total days. This figure of 107 is the desired output for me for a specific column.

Here is my desired table layout

TypeTotal Number of PeopleTotal Days
Male4+4+5+3+7 = 23107
Female1290
Others731

I believe I need to use aggr but anybody can help me out on the expression that I should use?

Thanks very much in advance

14 Replies
swuehl
MVP
MVP

Try

=sum( aggr( Days*sum(Box), Month,Type,Days ))

n1ef5ng1
Creator
Creator
Author

Sorry about the duplicate post.

The expression diden give me the result that I want, did you manage to get the value using the example file?

swuehl
MVP
MVP

Yes, I got 30, 44, ...

Check attached.

n1ef5ng1
Creator
Creator
Author

you got it correct. gosh but not me, I will try to find the logic behind these in 9 hours time, got to sleep now. thanks alot for ur help. basically aggr expression, you have to list out the expression follow by the dimension of the virtual table?

n1ef5ng1
Creator
Creator
Author

Hi guys,

Not sure if this is bug or something, I managed to solve this problem thanks to swuehl, he attached a working file for reference.

I am wondering is aggr a realiable code to use? As I copied the table to another file, the value changed with the same database, i did not change any script too.

When i upload the report to the server, the figure of the aggr column changed too.

why is this so? is it a bug?