Bar-Chart with calculated field

Hello everyone,
I use a maxOver function to get the new field “max duration” grouped By SessionID.
I want to represents a bar-chart of the sum of (max wt) per day it is not possible for me is there an other solution.
my dataset is an athena sources.

an exemple for my dataset

sessionID duration day
1112A 100 Mon
1112A 120 Mon
1112A 500 Mon
1112B 25 Tue
1112A 60 Mon
1112C 78 Mon
1112B 80 Tue
1112E 90 Mon
1112B 60 Tue
1112B 30 Tue
1112D 80 Tue
1112D 95 Tue
1112D 40 Tue
1112E 50 Mon
1112E 200 Mon
1112F 120 Tue
1112F 95 Tue
1112F 45 Tue

Thanks for your help.

Are you getting an error with not referencing columns?

Try doing it with a PRE_AGG


Then in your bar chart take the max of that.

1 Like

Thank you for your response @Max
Actually I want to:
1-get the max duration Over the SessionID ( maxDuration)

sessionID | Maxduration | day

1112A | 500 | Mon
1112C | 78 | Mon
1112B | 80 | Tue
1112D | 95 | Tue
1112E | 200 | Mon
1112F | 120 | Tue

2-get the sum of max Duration by Day (in a barChart)
so i want to get this in a bar-Chart:
Mon 778
Tue 295

Your solution will Give me :
Mon 500
Tue 120

The problem in the barChart quicksight will ask to add the SessionID in the fields even if i don’t need it the visual(I need SessionId only in the calculated Field), so i will get the Bar chart with the repetition of each session ID.

Thanks for your help.

Hi @Manoubi

Have you tried sumOver?

sumOver({duration}, [{date}, {day}], PRE_AGG)

Hi @Manoubi , @Max,

LAC-A function is better suited for this than LAC-W(sumOver).
You can get the desired result with the below calculation and letting QuickSight auto sum it in the visual. (See screen shot below)

Max session duration per day

Arun Santhosh