3 Replies Latest reply on Nov 12, 2018 11:26 PM by Akram Ebrahim

    Creating Dynamic Labels based on Aggregate


      I'm trying create a calculated field called lbl_drg that takes DRG Definition, a string field and assigns it to lbl_drg if the pecentage of Total Discharges is 1% or more or else it assigns the text other to lbl_drg.

      • First I created a calculated field that calculates the percent of Total Discharges and if the percentage is greater than 1 it displays True else False (see below).

      Second I created another field that returns field DRG Definition if True else "Other" (see below) and I get the error message:

      When creating the second calculated field lbl_drg cannot mix aggregate and non-aggregate or comparisons or results in IF expressions.



      I haven't used Tableau in this much detail before but can someone guide me as to how such dynamic field can be achieved with aggregates?





      Thanks in advance!