Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

avg aggr count

Hi all.

I need to find a count for all distinct WeekDays and then take the avg of that count for each of them

and then make a line chart with the weekdays (Sat, Sun,...etc).

 

 

avg(aggr(count({<[status] = {'0', '1'}>} distinct order_id),WeekDay))

 

I tried this but it's not working. In fact , it returns the same if i just do count({<[status] = {'0', '1'}>} distinct order_id)

 

Any suggestions?

18 Replies
sunny_talwar

Would you be able to share an image to show what you have and what you are looking to get? or some sample data?

ioannagr
Creator III
Creator III
Author

Yes, I have this one which is the count of the order_ids for all Saturdays, Sundays etc of all years.

 I need to calculate and show in this line chart a count for all distinct WeekDays and then take the avg of that count for each of them.

 

For example lets say on every Sat in history I counted 500 orderids.

but what is the expected count on any Saturday?

That's what I'm looking for.

y_grynechko
Creator III
Creator III

Hey, the issue here is a WeekDay, qlik thinks that it is a function of a week day not a dimension. Create flag in Calendar called WeekdayTest(or something like that) and use it in the calc. I am sure it is going to work 😉   

ioannagr
Creator III
Creator III
Author

Hey!Thanks for your input! But Weekday is coming straight from a master calendar, shouldn't it work anyways? 😬

y_grynechko
Creator III
Creator III

Is it blue or yellow when you use it in the set analysis? 

ioannagr
Creator III
Creator III
Author

It's yellow!

y_grynechko
Creator III
Creator III

Did you try what I asked for? 

Capture.PNG

ioannagr
Creator III
Creator III
Author

I don't know how to create this flag, so I'm looking for it.

Any help accepted and welcome though!

y_grynechko
Creator III
Creator III

In the master calendar add one line:

 weekday(Date) as [WeekdayTest],