# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

## compare d-7 sales to prior week

Hello,

I'm quite pleased with my progress so for but now it looks like I need a little help from the community:

I was able to calculate the sales of the last week by building the following expression

Sum({<OrderDate = {'>=\$(=Date(Max(OrderDate)-6))'}>} Sales)

my next step is to compare this value to the sales of the week before

Starting on: Max(OrderDate)-13

Ending on: Max(OrderDate)-7

Could you help me with this expressions?

Thanks

Tom

Tags (1)
1 Solution

Accepted Solutions
Valued Contributor III

## Re: compare d-7 sales to prior week

Maybe something like the below:

Sum({<OrderDate = {'>=\$(=Date(Max(OrderDate)-13))<=\$(=Date(Max(OrderDate)-7))'}>} Sales)

Hope this helps.

6 Replies
Contributor III

## Re: compare d-7 sales to prior week

Hi Tom,

Try this.

vprevious - Max(OrderDate)-13

vpresent - Max(OrderDate)-13

Sum({<OrderDate = {'>=\$(vpresent)<=\$(vprevious)'}, OrderDate=>} Sales)

Hope this helps!

regards,

Varun

Valued Contributor III

## Re: compare d-7 sales to prior week

Maybe something like the below:

Sum({<OrderDate = {'>=\$(=Date(Max(OrderDate)-13))<=\$(=Date(Max(OrderDate)-7))'}>} Sales)

Hope this helps.

MVP

## Re: compare d-7 sales to prior week

Sum({<YearDimensionName=, QuarterDimensionName= MonthDimensionName=, OrderDate = {'>=\$(=Date(Max(OrderDate)-13))<=\$(=Date(Max(OrderDate) - 7))'}>} Sales)

This portion in the above expression YearDimensionName=, QuarterDimensionName= MonthDimensionName= ignore the selection in Year, Quarter and Month fields and always shows last week details.

Hope this helps you.

Regards,

Jagan.

Honored Contributor II

## Re: compare d-7 sales to prior week

Hi Jagan,

Please verify your Set analysis expression. It is not working for me.

Thank you.

Not applicable

## Re: compare d-7 sales to prior week

that's the one, thanks Sinan!

MVP

## Re: compare d-7 sales to prior week

It should work, may be date format is the issue.