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: 
wayne-a
Creator
Creator

Calculating count per week

Hi, I'm having trouble calculating a count per week.  See image below.  I want the week count to be the total for the week regardless of the "When Verified" dimension.  So for every row with 7/2/2017 the value would be 2923.  I've tried numerous expressions using set analysis etc. but cannot get this to work.  Thanks in advance for any assistance. 

The latest attempt was the following:  Aggr(count([Order#]),Weekstart(Collected))

CountPerWeek.JPG

1 Solution

Accepted Solutions
sunny_talwar

Unfortunately, you cannot use a calculated dimension in Aggr() function. May be create a new field in the script like this

WeekStart(Collected) as WeekStart_Collected

and then try this

Aggr(Count([Order#]), WeekStart_Collected)

or this

Aggr(NODISTINCT Count([Order#]), WeekStart_Collected)

View solution in original post

2 Replies
sunny_talwar

Unfortunately, you cannot use a calculated dimension in Aggr() function. May be create a new field in the script like this

WeekStart(Collected) as WeekStart_Collected

and then try this

Aggr(Count([Order#]), WeekStart_Collected)

or this

Aggr(NODISTINCT Count([Order#]), WeekStart_Collected)

wayne-a
Creator
Creator
Author

Thanks Sunny!  That was it.  I changed it to load it specifically and works correctly.  I did need the NODistinct as well.

Thanks again.