5 Replies Latest reply: Nov 25, 2014 10:08 PM by Renata Stepic RSS

    Median value not showing in Straight Table

    Renata Stepic

      Hi,

      I have a straight table with 2 values and I can't seem to get the Median to show for the NonAdmitted column. The if for the Admitted works but when I apply the same calculation for the NonAdmitted column, no data comes up. Is this because the IF statement can't handle more complicated calculations?

       

      if(KPINEAT = 'NonAdmitted' and LEFT(svNEATMeasure,1)=1,Fractile(aggr($(mEDNANeatDuratioinFirstSeentoDeparture_SelYr) ,[ED Episode No] ),0.5),

      if(KPINEAT = 'NonAdmitted' and LEFT(svNEATMeasure,1)=2, $(mEDNANeatDuratioinFirstSeentoDeparture_SelYr),

      ))

        • Re: Median value not showing in Straight Table
          Henric Cronström

          The If() function can handle much more complex (but correctly written) calculations...

           

          Your expression contains many things that could be problems:

          • The first condition is KPINEAT = 'NonAdmitted' and LEFT(svNEATMeasure,1)=1 which is an expression that lacks aggregation functions. Hence, it will most likely evaluate to NULL. The same is true for the condition of the 2nd If(). Read Use Aggregation Functions!.
          • The second parameter of the first If() contains a Fractile( aggr( $(mEDNANeatDuratioinFirstSeentoDeparture_SelYr), ...  which may or may not work, depending on whether your variable contains an aggregation function or not. It should contain one, otherwise this will evaluate to NULL,
          • The second parameter of the second If() is empty. It shouldn't be. Enter the Null() function or a text string 'Error' enclosed in single quotes.

           

          HIC