You can do this with a calculated field that looks something like this:
MAKEDATE([Year], [Month], 1)
See attached workbook.
If this helps to resolve your issue, please mark this answer as helpful or the "correct answer". This will help others who may have a similar question in the future. Thanks
Use This Formula
MAKEDATE(RIGHT(Your String,4),LEFT(Your String,2),01)
makedate is not supported by my db.
Ah I see. You must be using a live connection. Seems like you got a viable solution from Mahfooj though!
Just to add this can also be done in tableau from any data source using the DATE function. i.e.
DATE(RIGHT([Your String],4) + "/" + LEFT([Your String],2) + "/01")
I believe this will work for all data sources whereas the DATEPARSE solution will not.
yeah, its live connection.
DATEPARSE Worked ,i got what i want.
I will try the solution from Paul Cawford too.
@Paul Cowford:- may i know which scenarios the datepars may not work? because i dont want to change the logic for any reason.
I'm not sure of all the scenarios but in tableau 10.5 the DATEPARSE function does not work with a Microsoft SQL data source (and presumably others)