3 Replies Latest reply on Oct 18, 2012 2:59 AM by Caron Lloyd

    How do I create calculated fields which will return values within a financial period

    Caron Lloyd

      How do I create a calculated field which will return a financial period in Tableau.

       

      So far I've been created a calculated field as follows:

       

      case [Time scale]

      when "Daily" then if [Date] = [Choose Date] then 1 else 0 end

      when "Weekly" then if datetrunc('week', [Date]) = datetrunc('week', [Choose Date]) then 1 else 0 end

      when "Monthly" then if datetrunc('month', [Date]) = datetrunc('month', [Choose Date]) then 1 else 0 end

      when "Yearly" then if datetrunc('year', [Date]) = datetrunc('year', [Choose Date]) then 1 else 0 end

      end

       

      - [Choose date] and [Time scale] are a parameters

       

      My query is:

      The financial periods run from the 25th current month to 24th of the following month.

      On the "Monthly" filter I want to be able to choose a date, say the 15th Oct and that will return the values between the 25th September to 15th Oct.