3 Replies Latest reply on Dec 27, 2016 2:57 PM by Joe Oppelt

    Using different dimensional datatypes in a logical calculation

    Dani Cheng

      EDIT: I added a sample packaged workbook using the Sample Superstore dataset. The first two sheets are the two views I'm trying to replicate using parameter control. The third sheet is supposed to have the two faulty calculated fields in the rows shelf.

       

      Hi everyone,

       

      I have a crosstab sheet that displays various measure names column-wise, with a date dimension and a string dimension (Date, Client Name) in the rows shelf. I created a parameter that toggles between date view and client view so I could use parametric control to switch the first-order and second-order dimensions. I created two calculated fields, "View By Type" and View By Type Complement" that look like this, that I intended to use as the pills in the rows shelf:

       

      View By Type

      CASE [View by]

      WHEN 'Date' then [Date View Level]

      WHEN 'Client Name' then [Clientname]

      END

       

      View By Type Complement

      CASE [View by]

      WHEN 'Date' then [Clientname]

      WHEN 'Client Name' then [Date View Level]

      END

       

      I keep getting errors saying that the result types must match. Clientname is a string type, while Date View Level is a calculated field that switches between different date aggregations depending on user input. Using IF-ELSE statements also produces the same error. Does anyone know of a workaround or a type-agnostic logical calculation? Thanks!