2 Replies Latest reply on Sep 21, 2016 5:32 AM by Eric Decker

    Using a Parameter to switch between calendar and fiscal year dates

    Eric Decker



      Attached is a simple packaged workbook example with a Transaction Date & Qty. I essentially would like to have my parameter ([Date Chooser]) to drive changes in my view to switch between a fiscal and calendar look. I'm curious if this is even possible the way that I've loaded the table calculation, so I thought I'd ask the experts


      I've started by duplicating my Transaction Date and calling that field Transaction Date (FY). I then changed that field to have a Fiscal Year starting in the Month of September. You'll see the two tabs (Calendar & Fiscal) that have each Year/Month by their appropriate Date with the Sum of Quantity. So far so good.


      Next, I created a parameter dubbed "Date Chooser" which is setup as a String with two options in a list; "FY" and "CY". Then I created the Table Calc with the Case statement to depict which Date field should be seeded upon the parameter selection. The new Calculated field dubbed "Fiscal / Calendar Date" is called out as:



      Now, when I drop that Calculated Field onto the Columns shelf, expand it out so that it is Year/Month and use my parameter to switch between the two, you'll notice it doesn't actually change. I'm guessing this is due to Tableau defaulting to the inherent calendar date only, despite there technically being a fiscal year version within the newly created date field. If that's the case, does anyone know a work around that I could use to change the physical view of a sheet?


      I have a workaround where I could just drop two sheets into a container on a dashboard (each sheet is setup identically but with it's respective Fiscal or Calendar date field as it's date driver), and have a parameter switch between the sheets and hide the sheet that's not in use, but I'd rather address it on the same sheet if possible.


      Any suggestions??