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

Compare ongoing week with the previous week

Hello,

so I've been using this expression to monitor my Sales for the ongoing week (orderdate is my time stamp)

Sum({$<OrderDate = {">=$(=yearstart(Max(OrderDate)))  <= $(=(Max(OrderDate)))"}>} Sales)

What I would like to see is the figures of the week before up until the same day of the week.

In the example below on Wednesday 10/1 I have had 120€ in sales for the ongoing week

What I would like to know is what expression I can use to have the sales of last week up until Wedneday

Using the example below I'm looking for 80 € (sales of 1/1 until 3/1)

Can anyone help?

Thanks

Tom

2 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,


Try like this


For Current Week:

Sum({$<OrderDate = {">=$(=WeekStart(Max(OrderDate), -1))  <= $(=Date(Max(OrderDate)))"}>} Sales)


For Previous Week:

Sum({$<OrderDate = {">=$(=WeekStart(Max(OrderDate), -1))  <= $(=Date(Max(OrderDate), -7))"}>} Sales)


Hope this helps you.


Regards,

Jagan.

Not applicable
Author

the expression for previous week gives the entire week, I'm looking for something more complex.