2 Replies Latest reply on Jan 30, 2019 10:40 AM by Yantezia Patrick

    Creating Exception within Existing Calculation

    Yantezia Patrick

      Hi there,

       

      This is probably covered somewhere deep in the calculations forum, but I couldn't find it and I need a bit of help.

       

      I'm working on a simple index in Tableau, which includes marketing metrics like impressions, clicks, page position, etc. I've created a calculated field to return the appropriate measure for a parameter, ie. 

       

      IF [Parameters].[All Metrics Selector] ='total impressions' THEN [Total Impressions]

      ELSEIF [Parameters].[All Metrics Selector]='total clicks' THEN [Total Clicks]

       

      And so it goes on, because I have a line graph that the parameter belongs to, but feel free to ignore the idea of a parameter right now. What I need assistance with is the following calculation for the index: ([All Metrics Selector])/(LOOKUP(ZN([All Metrics Selector]), -1))*100

       

      The index is currently calculated as current year/previous year. However, I have one metric (page position) that needs to be calculated previous year/over current year. How can I amend the current calculation to account for this one calculation that needs to be switched around?

       

      Thanks!!