6 Replies Latest reply: Aug 20, 2015 11:45 AM by jagan mohan rao appala

# 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

• ###### 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

• ###### 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.

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

that's the one, thanks Sinan!

• ###### 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.

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

Hi Jagan,

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

Thank you.

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

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