1
votes

Is it possible to show in Tableau a line plot having option to toggle between month on month and week on week changes in same view?

Currently the view is at monthly level as shown below and I want to switch to weekly option in same view.

enter image description here

Here is the snapshot of my data.

enter image description here

1
See the answer below! Do tell if it worked or if you require some modification - AnilGoyal

1 Answers

1
votes

I'm replicating a solution/answer (workaround) on sample superstore data

  • Let's assume your view is something like this GIF

enter image description here

  • Add a parameter say toggle parameter with values 1 and 2 only display these as monthly view and weekly view respectively.

  • Add a calculated field say new order date with the following calculation

CASE [Toggle parameter]
WHEN 1 THEN DATETRUNC('month', [Order Date])
WHEN 2 THEN DATETRUNC('week', [Order Date])
END
  • Add this field on view instead of [order date] and see you can get a viz like this

enter image description here

  • Finally you can edit the display values/axis as per taste