
1. Re: excel formula to tableau
marc de Latour Aug 14, 2018 3:06 PM (in response to Imran Azam)what are you trying to do?
get the right date?
add a zero? it looks like your trying just to add a leading zero to your dates that are less than 1
post sample workbook

2. Re: excel formula to tableau
Imran Azam Aug 14, 2018 3:42 PM (in response to marc de Latour)The start date formula is getting the first date of the month and year from a given date so for example if the given date is 12/08/2018 the formula will retuen 01/08/2018

3. Re: excel formula to tableau
Okechukwu Ossai Aug 14, 2018 4:22 PM (in response to Imran Azam)Hi Imran,
Try this.
[Start Date]
DATETRUNC('month', [Given Date])
What do you want to achieve with formula 2? It appears it is calculating datediff in months with various logic. I believe the code below should work.
IF DATEDIFF('month', [Date 1], [Date 2]) < 1 THEN 1
ELSE DATEDIFF('month', [Date 1], DATEADD('day', 15, [Date 2])) END
I noticed that the cells have been locked using $ sign. So, you may use FIXED LOD expression to calculate [Given Date], [Date 1] and [Date 2]. I can't do this without seeing your data.
Hope this helps.
Ossai