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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with aggr function

Hi all,

I ask someone for help

My problem is this:

In a data structure similar to that present in the attached file, I would like to create a table (see Table 2-B)

when I extract only the rows of people in a given month did not have sales and at the same time

compared with sold in the previous month.

I used the aggr with Set Analysis table see Table 2 and Table 2-B.

1-Why the table Table 2 does not work?

If I do not apply any selection on the month it seems to work well (see Table2-B).

For example Amanda has not had sales last month, but he's had in the previous month.

2-If I select a month, for example, three months, I think you should not change anything, it does not work..

Conversely, if I select for example the second month (months number 2),

I would expect to see in the table Table2-B only Frank for the month 2 had no sales while he's had in month 1.

Can someone give me a tip?

    Hello and Thank you

1 Reply
Not applicable
Author

I solved this problem with this logic.

I created two variables, one to store the last date and the second variable to store the last date -1.

Vmax: = MAX (Month)

vMaxMin1: = MAX ({$} <Month-={"$(vMax)"}> Month)

In the chart I created two expressions: LAST and LAST -1

LAST: Sum ({} <Month={"$(=max(Month))"}> Sales)

LAST -1: Sum ({} <Month={"$(vMaxMin1)"}> Sales)

I hope helped you