Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
MikeJones
Creator
Creator

Summing from daily to weekly

Hi, I am using the following to determine daily the number of people working in a table with the dimension individual dates and it works fine.

count({<JobType-={'Type1'}, [QLIK_locationsDates.Date]={"<$(=Today())"},[QLIK_Jobs.Client]={'XXXX'},Resource-={"*Unassig*", "*Emergen*"}>} distinct Resource))

However, when I change the dimension for weeks, it takes the average for the whole week.

What I wish it to do is sum Monday's value plus Tuesday's value plus.... Sunday's value to get a weekly total.

 

Labels (2)
1 Reply
aveeeeeee7en
Specialist III
Specialist III

Hi @MikeJones 

It's better you create weekly flags (Week([QLIK_locationsDates.Date]) in backend script and use that Week Flag inside Set analysis (Max Week Flag field).

It will dynamically pick the Weeks on Date selections in Front end.

or,  you can try this:

count({<JobType-={'Type1'}, [QLIK_locationsDates.Date]= {">=$(=WeekStart([QLIK_locationsDates.Date]))<=$(=Weekend([QLIK_locationsDates.Date]))"},[QLIK_Jobs.Client]={'XXXX'},Resource-={"*Unassig*", "*Emergen*"}>} distinct Resource))

or,

count({<JobType-={'Type1'}, [QLIK_locationsDates.Date]= {">=$(=WeekStart(Today()))<=$(=Weekend(Today()))"},[QLIK_Jobs.Client]={'XXXX'},Resource-={"*Unassig*", "*Emergen*"}>} distinct Resource))

or,

count({<JobType-={'Type1'}, [QLIK_locationsDates.Date]={">=$(=Today()-7)"},[QLIK_Jobs.Client]={'XXXX'},Resource-={"*Unassig*", "*Emergen*"}>} distinct Resource))

Regards,

Av7eN