2 Replies Latest reply on Jun 19, 2018 5:43 AM by Alex Braun

    Creating calculated field in Tableau using relative date filter and parameter

    Anjali Sn

      I have a date column using which I created a "relative date" filter as follows:

      enter image description here

      I have a parameter like below:

      enter image description here


      What I need is that when "Day" is selected from the above parameter, I get the daily average of the field (Orders) within the selected range of date; when "Week" is selected, I get the weekly average of the field(Orders) within the selected range of date.

      i.e., if date range selected is 5/1/2018 to 6/30/2018, and if total orders in this date range is 800, then the daily average (if "Day" is selected from that filter) will be 800/61 = 13.11. However, if "Week" is selected, then the weekly average will be 800/9 = 88.88


      Please help! Thanks!!