0 Replies Latest reply on Feb 10, 2016 8:39 AM by JJ Ruescas

    JS API - Selecting Marks with Date field in format "Month Year" doesn't seem to work

    JJ Ruescas

      Hi all,

      I have a workbook inside of a Dashboard.

      This workbook was initially displayed by MONTH(Effective Date) (e.g.: "May"), Where Effective Date is a Date Value dimension from my DataSource.


      After publishing the workbook to my Tableau Server, I was able to selectMarks on that workbook like this:



              worksheet.selectMarksAsync("MONTH(Effective Date2)", selectedMonths, 'REPLACE');



      where selectedMonths were an array of the Months that I wanted to select. E.g: ["May", "October"].

      So far, so good.....


      Then I had to change my MONTH(Effective Date) to be grouped also by year, that means "May 2015".

      The result is that now, not selection is marked with the selectMarksAsync JS function.


      I even created a Calculated Field called, MyMonth that is defined as DATETRUNC('month',[Effective Date]).

      I still can display the viz the way that I want (that's good) but selectMarksAsync doesn't work yet. I'm using it like this:



                worksheet.selectMarksAsync("MyMonth", "2015-08-01", 'REPLACE');



      I'm using the hardcoded value "2015-08-01" just as an example. I also tried sending the Numeric month and the Month name. Not working yet.


      If anyone could shed some light about it, I'd really appreciate it.