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

Can I use a function instead of a dimension in an aggr?

I would like to create an aggr expression, using the function WeekDay() as the aggr field.  Does anyone know if there is a way to do this?  Just replacing the dimension with WeekDay() returns null values.  I want to show the average sales for each day of the week (average for a Sunday, Monday, etc).

avg(aggr(sum(NET_SALES), WeekDay()))

Thank you!

2 Replies
MayilVahanan

HI

Try like this,

In script, load weekdays and then use it as dimesion

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
swuehl
MVP
MVP

I believe an aggr() dimension must be a field, not a calculated dimension. So, if possible, it would be easiest to create that field in the script.