You need to pivot the data so that the years are all in a single column.
then you should be able to do a dateparse like this: DATEPARSE("dd/mm/yyyy", "01/01"+[Year])
... depending on your data types, etc.
As Chris said you need to pivot your data. In Tableau this is how it can be done.
- Click on Data Source on the bottom left corner.
- Then select the year column headers which you want to pivot.
- Right click on the column header and select 'Pivot'.
- This is what you will get after pivoting.
- Change the header names accordingly.
- Finally, use DATEPARSE as below.
Thanks and Regards,
Thanks! Quick followup. I have multiple column years (i.e. one set of column years for malaria deaths and one set of column years for Malaria infections). How do I add them both to a pivot without merging the values. In other words, I'd like to create a unique column for each unique set of dates.
So let us suppose we have two dates columns. One for hire date and one for termination date. I can pivot these two columns then Pivot field names can be used to identify which date it is ('Hire Date' or 'Termination Date') and Pivot field values will give you the dates.