2 Replies Latest reply: Jun 1, 2018 11:48 AM by Sunny Talwar RSS

    If statements to determine grouping

    Carlos Bondoc

      Hi Qlik-ers!

       

      Need help formulating this expression to determine grouping for Positive-Negative-Indeterminate outcomes:

      = If([Exit Destination]='Permanent housing for formerly homeless persons (HUD)','Positive'

      ,If([Exit Destination]='Rental by client, no ongoing housing subsidy (HUD)','Positive'

      ,If([Exit Destination]='Rental by client, with other ongoing housing subsidy (HUD)','Positive'

      ,If([Exit Destination]='Rental by client, with VASH subsidy (HUD)','Positive'

      ,If([Exit Destination]='Owned by client, no ongoing housing subsidy (HUD)','Positive'

      ,If([Exit Destination]='Owned by client, with ongoing housing subsidy (HUD)','Positive'

      ,If([Exit Destination]='Staying or living with family, permanent tenure (HUD)','Positive'

      ,If([Exit Destination]='Staying or living with friends, permanent tenure (HUD)','Positive'

      ,If([Exit Destination]='Jail, prison or juvenile detention facility (HUD)','Negative'

      ,If([Exit Destination]='Safe Haven (HUD)','Negative'

      ,If([Exit Destination]='Place not meant for habitation (HUD)','Negative'

      ,If([Exit Destination]='Deceased (HUD)','Negative'

      ,If([Exit Destination]='Emergency shelter, including hotel or motel paid for with emergency shelter voucher (HUD)','Negative'

      ,'Indeterminate')))))))))))))


      However, there are different levels of programs and some programs may lead to different results.


      Can I have nested IFs such as If([Program]="Emergency"]+[Exit Destination]='Permanent housing for formerly homeless persons (HUD)','Positive'


      Please help