2 Replies Latest reply on Dec 27, 2016 11:11 PM by Johnson Hwang

    why my calculated field doesn't work

    Johnson Hwang

      Hi All,


      can anybody help me on below calculated field which to categorize the price range. but tableau remind me "cannot mix aggregate and non-aggregate argument with this function", how to realize my requirement to count the No. of record for each quartile. Thanks


      IF          [Price]<=MIN ([Price])                                                                                       THEN '≤ Min Value'

      ELSEIF [Price]<=PERCENTILE([Price],0.25) AND [Price]> MIN([Price])                       THEN '≤ 25% Quartile'

      ELSEIF [Price]<=PERCENTILE([Price],0.50) AND [Price]> PERCENTILE([Price],0.25) THEN '≤ 50% Quartile'

      ELSEIF [Price]<=PERCENTILE([Price],0.75) AND [Price]> PERCENTILE([Price],0.50) THEN '≤ 75% Quartile'

      ELSE                                                                                                                                       '≤ Max Value'