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: 
SDT
Creator
Creator

Aggregation on full weeks using individual Date field

Hello,

I have a line chart in an application with two dimensions.

1) IF(Date<Today(0),Date(Weekend(Date),'YYYY-MM-DD'))

2) LostHoursType

The lines are SUM(LostHours)

I am trying to add a reference line for the average.

AVG(AGGR(SUM(LostHours),WeekEnd(Date)))

Does not work.

AVG(AGGR(SUM(LostHours),Date))

Gives me the average for a single Date.

How can I aggregate on a week worth of data?

 

Thank you

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

Advanced aggregations with aggr() or TOTAL require native fields and not calculated dimensions. Therefore just replace this calculation with an appropriate field from the calendar.

View solution in original post

2 Replies
SDT
Creator
Creator
Author

It is not exactly correct, but I ended up implementing this for now:

AVG(AGGR(SUM(LostHours),Date))*7

marcus_sommer

Advanced aggregations with aggr() or TOTAL require native fields and not calculated dimensions. Therefore just replace this calculation with an appropriate field from the calendar.