Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis - Previous Week using a Date time Field

I'm struggling to write an expression in a line graph to show the previous week's information. I'd also like a Year to Date average to show as a separate line.

Count({$<(=Week(DateCreated))={$((=Week(DateCreated))-1)>},if(type = 'SHIPMENT',type))

Can someone explain where I am going wrong and the reason for it not working?

5 Replies
ecolomer
Master II
Master II

Try without =

Count({$<(Week(DateCreated))={$((=Week(DateCreated))-1)>},if(type = 'SHIPMENT',type))

Not applicable
Author

Doesn't make a difference unfortunately - it appears to just be plotting the current week selection and not the week-1

Not applicable
Author

Try

Count({$<(Week(DateCreated))={$((=Week(DateCreated)-1))>},if(type = 'SHIPMENT',type))

JonnyPoole
Employee
Employee

Check out this explanatory post on grabbing prior periods.

the above() function may help you grab previous week data in a chart.

Calculating rolling n-period totals, averages or other aggregations

erivera10
Creator
Creator

I also saw what you saw, either.