Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
jmialoundama
Specialist
Specialist

Set analysis group by columns

Hello, I have the following table:

Article Date week_no Number article
1101 05/04/2023 14 1
1101 06/04/2023 14 1
1123 05/04/2023 14 1
1123 06/04/2023 14 1
1515 05/04/2023 14 1
1515 06/04/2023 14 1
8087 05/04/2023 14 1
8087 06/04/2023 14 1
7896 45033 15 1
7896 45034 15 1
8585 45033 15 1
8585 45034 15 1
7412 45033 15 1
7412 45034 15 1

I want to sum the articles by taking the max date and grouping by week number.

I know it is possible to do it in script but I want to do it in set analysis.


thank you in advance for your help

Labels (5)
1 Solution

Accepted Solutions
jmialoundama
Specialist
Specialist
Author

Hi @BrunPierre 

The expression works and returns me the correct results.

Thank you so much 🙂

View solution in original post

4 Replies
BrunPierre
Partner - Master
Partner - Master

Sum(If(Date=Aggr(NODISTINCT Max(Date), week_no),[Number article]))

jmartineze
Partner - Creator
Partner - Creator

Hi, try with

Sum( aggr( Sum({<Date={'$(=Max(Date))'}>} [Number articule]),week_no))

jmialoundama
Specialist
Specialist
Author

Hello @jmartineze ,

I tried your solution however I have the impression that there is a problem with "Sum({<Date={'$(=Max(Date))'}>} " .
The expression returns 0.

jmialoundama
Specialist
Specialist
Author

Hi @BrunPierre 

The expression works and returns me the correct results.

Thank you so much 🙂