6 Replies Latest reply: Jul 20, 2017 2:11 AM by Sada Siva

# Promotion event wise Data - last 'n' Days

Hi Team,

I have a list of promotion events, Promo_start_date and Promo_end_date, lets consider i am having promotion events for last 3 years.

To show the current year and last year Promo sales, i am using

Sum({<year={\$(=max(Year))}>}sales)

and

Sum({<year={\$(=max(Year)-1)}>}sales)

Next i need to show last 7 days sale. When i use Max(promo_to_Date)-7, it's not throwing desired output, how can i build the expression?

Help me on this. Thanks in advance.

Regards,

• ###### Re: Promotion event wise Data - last 'n' Days

Try with this:

Week(promo_to_Date) - 7

but you will have trouble at the start of the year

• ###### Re: Promotion event wise Data - last 'n' Days

Hi Juan,

Need to consider the year aswell, I am looking current and last year numbers by promo event

Regards,

• ###### Re: Promotion event wise Data - last 'n' Days

you can tho this in the script:

AUTONUMBER( year_field & '-' & month_field & '-' & WEEK(date_field))  AS new_field

So you can rest 7 to the new_field

¡Good luck!

• ###### Re: Promotion event wise Data - last 'n' Days

Hi Juan,

I have linked promotion dates to my Posting date, from there am picking the sales.

Here the problem was every promotion start in different date and end with different dates. When i am seeing the current year sales, overall i am able to view. How can i show last 7 days of every promotion days by promotion event.

Hope you understand my problem.

Regards,

• ###### Re: Promotion event wise Data - last 'n' Days

So you have to create a flag (a new field) in the script to know for each one is you must show it or not.

• ###### Re: Promotion event wise Data - last 'n' Days

if(

(Date<=Promo_Date_To) and(Date>= Promo_Date_To - 6),

Promo_Event

)

this condition works for me, to get last n days sales.