5 Replies Latest reply on Oct 23, 2018 6:48 AM by seraj alam

# How to Calculate No of Days between Start Date and end date Parameters

Hi

I Have created start date and end date Parameters. I need to Calculate no of Days between start date and end date, If I have selected Start date: 10/1/2018 and end date: 10/23/2018. Here we have 23 days. to get this value which calculation i need to use, by using calculation I need to calculate Average sales per day. Suppose if its 23 days i need to get average calculation based on this 23 days. if its 30 days based on that 30 days I want to show average daily sales.

I used Datediff('day', start Date, End Date) to get the no of days between start date and end date, but this is not working out.

• ###### 1. Re: How to Calculate No of Days between Start Date and end date Parameters

Hi, Subhashini

Can you provide a sample workbook to show why it is not working?

ZZ

• ###### 2. Re: How to Calculate No of Days between Start Date and end date Parameters

It is giving the value 29 days, but it should be 30 days right? Here is the calculation and date parameters

1 of 1 people found this helpful
• ###### 3. Re: How to Calculate No of Days between Start Date and end date Parameters

Its working for me can you please attach a workbook so it would be easy to help,

• ###### 4. Re: How to Calculate No of Days between Start Date and end date Parameters

Its working, but what I mean to say is it showing no of days 29. It should be 30 days so that only I'm asking in tableau forum and I can't share the work book because it's a oracle database connected

• ###### 5. Re: How to Calculate No of Days between Start Date and end date Parameters

in that case you use below calculation.. it will give you 30 days if you want in that way..

DATEDIFF('day',[start date],[End Date])+1

But Tableau datediff calculate just to exclude start day to exclude the day