3 Replies Latest reply on Feb 21, 2018 2:30 AM by Abdul Rahman

# Urgent Help Needed: Please help me in how to get the date values from 1st feb 2015 till 31st Jan 2016 as periods 1 &  1st feb 2016 till 31st Jan 2017 as Periods 2 in calculated field

Hi All,

I have a requirement where I should show the sales quantity for last 36 months starting February 2015 till January 2018 in three different time periods. The time periods are as follows.

Previous units period 1: feb 1 2015 till jan 31 2016

Previous units period 2: feb 1 2016 till jan 31 2017

current units pd 3: feb 1 2017 till jan 31 2018

I used the below formula in the calculated field for getting Previous units period 1 and Previous unit period 2:

Previous units period 1: IF [Calendar Daily Dt]>=
THEN [Calendar Daily Dt] END

Previous unit period 2:IF [Calendar Daily
Daily Dt] END

When I used the above formulas I am not getting the Last three days of January Month(29,30,31).It is getting cut in the report.

Thanks for your help in advance. I am using Tableau 10.2.2. version.

Thanks,

Suresh

• ###### 1. Re: Urgent Help Needed: Please help me in how to get the date values from 1st feb 2015 till 31st Jan 2016 as periods 1 &  1st feb 2016 till 31st Jan 2017 as Periods 2 in calculated field

Hi Suresh,

The logical error is in the last -1 in every part of the calcs.

then jump back 13 / 25 months from there --

straight to the January 28th.

The 'right' part of the calcs would be like this:

Please find the attached illustrating the difference.

Hope it helps.

Yours,

Yuri

1 of 1 people found this helpful
• ###### 2. Re: Urgent Help Needed: Please help me in how to get the date values from 1st feb 2015 till 31st Jan 2016 as periods 1 &  1st feb 2016 till 31st Jan 2017 as Periods 2 in calculated field

Hi Yuriy,

Thanks for ur help.

The above formula worked!

Regards,

Suresh

• ###### 3. Re: Urgent Help Needed: Please help me in how to get the date values from 1st feb 2015 till 31st Jan 2016 as periods 1 &  1st feb 2016 till 31st Jan 2017 as Periods 2 in calculated field

HI Suresh,

What If you open this dashboard next month ? As you have used Today function in Datetruc so next month It will start taking month as 3 and it will go back number of month what mentioned.