5 Replies Latest reply on Aug 13, 2018 7:05 AM by Aditya Singh

Last 15 days based on date selection

Hello everyone, I have a date filter. When i select a particular date   from the filter/parameter i should see last 15 days data.

Kindly help me out with the logic. ( sample super store)

For example: If i select aug 13th I need to see the data from July 29 to aug 12 ( last 15 days).

Regards,

Koushik.

• 1. Re: Last 15 days based on date selection

Hi Koushik,

Write a calculation like below

datediff >0 is because to eliminate the future dates

hope this helps kindly mark this answer as helpful/correct so that it will help others

BR,

NB

1 of 1 people found this helpful
• 2. Re: Last 15 days based on date selection

Hi Koushik,

You can try

If Datediff('day',[Order Date],[date]) <= 15 and Datediff('day',[Order Date],[date]) >= 0

Then [Sales] End

Hope this helps.

Soham

2 of 2 people found this helpful
• 3. Re: Last 15 days based on date selection

Hi

Create parameter [date]

create calc as below

if datediff('day',[Date],[Start Date]) <= 15  and datediff('day',[Date],[Start Date]) >= 0  then 'True' else 'False' end

drag this into filter and select true.

Drag date in columns and drag sales into row.

now show parameter and select date and get 15 days

thanks

sankar

2 of 2 people found this helpful
• 4. Re: Last 15 days based on date selection

HI Koushik,

Create a flag with below logic:

Select Date is a parameter.

Flag = DATEDIFF('day',[Order Date],[Select Date])<=15 and DATEDIFF('day',[Order Date],[Select Date])>0

use it in filter shelf and select "true".

1 of 1 people found this helpful
• 5. Re: Last 15 days based on date selection

I haven't tried it but this might work, create a calculated field and add as filter with true selection to the sheet.

if [Order Date] < [Date Parameter] and [Order Date] >= DateAdd('day',-15, [Date Parameter]) then "true" else "false" end.

Hope this helps!

1 of 1 people found this helpful