1
votes

Tableau is reading my dates wrong. I have 2 columns, Date and number for each day. The date format is “yyyymmdd” i.e. (20160617) and per day number is integer. I am fetching this data directly from SQL server and my problem is, tableau is reading my dates wrong. So I tried DATEPARSE() to convert my date. My DATEPARSE function is : DATEPARSE(“yyyymmdd”,”Date”) , now after using DATEPARSE function, I get NULL for my dates. Can anyone please help me why I get NULL for dates, my query returns 30-day data which is divided into per day count. Sample after running the query on SQL

Date Per day number 20160617 215674

Tableau does not accept this date format and I applied DateParse(), which I guess is returning string since my date is null. I would ideally like to get the correct date so I can apply a trend line on my data. Thanks in advance. Cheers!

1
can you share a sample workbook?Bernardo
@Bernardo...sorry my workbook got modified by external staff. Can't share that anymore. Cheers for your help though!Vaibhav Thapliyal

1 Answers

3
votes

You aren't using DateParse() correctly. The second parameter, which you have as "Date", should be the name of the field you want parsed. So for example, if you store 20160617 in a field called my_date_as_integer, your function should be DateParse("yyyymmdd", [my_date_as_integer])