This is due to how we store these values internally. While the field is represented as a string, it is actually a integer that we then transform at display time. In your case, you should be able to use a value like 201610 to filter for October 2016 of your MY(Date) field.
You can always figure out things like this by following the steps below.
- Right click your date field
- Hover over create and click custom date
- Select Month / Year and click OK
- Right click the created field and click Describe
- Copy the formula that appears into a new calculation
- Drag this calculation into the view to see what the real value is
I hope this helps out.
Also, thanks a million for such a thorough and clear question!
Heartly thanks Dan!! your suggestion and guide worked perfectly. many thanks, since I played too much to get this work but I failed every time.
Can you help me more? I have to apply same filter to another dashboard also but that filter is coming from blended data-source.
Like this: I have column from blended source : "report period str" and it is calculated field from date column like below. It doing nothing but just populating "year-quarter" or "year-month" in proper format as per parameter selected.
when 'month' then str(datepart('year',[report period]))+'-'+
(if datepart('month',[report period]) < 10 then '0' else '' end)+
else str(datepart('year',[report period]))+'-Q'+str(datepart('quarter',[report period]))
I am using below JS option while initializing Viz.
var currentSheet , Activesheet;
var containerDiv = document.getElementById("vizContainer");
url = "servername/viewsworkbookname/viewname?:embed=y&:showShareOptions=true&:display_count=no&:showVizHome=no",
"report period str": "2016-05",
onFirstInteractive: function ()
Activesheet = viz.getWorkbook().getActiveSheet();
viz = new tableau.Viz(containerDiv, url, options);
But above script is not setting default filter to "2016-05"
Thanks once again Dan!!