7 Replies Latest reply on Mar 30, 2018 9:10 AM by Jim Dehner

    How to create a calculated field with variable inputs

    Robert Morgan

      Hi all, I'm relatively new to Tableau and am looking to create a calculated field. It's hard to describe what I want to do but easier if I show it:

       

      The Tableau workbook file with mocked up data is attached. It contains the data shown in the Excel snapshot below, except for the "Index" field, which is the calculated field I want to create in my Tableau desktop file.

      In the Tableau file, the "Product" and "Month" fields are shown as filters.

       

      I always want to base the calculated field (Index) on the "Overall" Partner value that results from the filtered criteria. So...

      * If I was creating this field in Excel, for row 2, it would look like this: =((d2/d$2)/(e2/e$2))*100      (The resulting Index for the "Overall" partner is always 100)

      * If I was creating this field in Excel, for row 3, it would look like this: =((d3/d$2)/(e3/e$2))*100      (The resulting index is 70, in this case)

      ...Etc.

       

      As I mentioned, the values for the calculated fields should change dynamically based on the Audience and Est Pop data from the "Overall" Partner that results from the filtered Product and Month selections.

       

      Thank you.