6 Replies Latest reply: Oct 4, 2017 7:54 AM by Sunny Talwar RSS

    Nested If statement in Dimension

    James Rizzitano

      I have this nested if statement that does not seem to be working in qliksense.

       

      Can you tell me what's wrong with it.  The error says I'm missing a ")" but I can't see where.

       

       

      =if(left(ProdCode, 2) = '1I' or left(ProdCode, 2) = '2I' or left(ProdCode, 2) = '3I' or left(ProdCode, 2) = '4I' or

      left(ProdCode, 2) = '5I' or left(ProdCode, 2) = '6I' or left(ProdCode, 2) = '8I' or left(ProdCode, 2) = '9I','Instruments',

      if(left(ProdCode, 2) = '1C' or left(ProdCode, 2) = '2C' or left(ProdCode, 2) = '3C' or left(ProdCode, 2) = '4C' or

      left(ProdCode, 2) = '5C' or left(ProdCode, 2) = '6C' or left(ProdCode, 2) = '8C' or left(ProdCode, 2) = '9C','Consumables',

      if(left(ProdCode, 2) = '1P' or left(ProdCode, 2) = '2P' or left(ProdCode, 2) = '3P' or left(ProdCode, 2) = '4P' or

      left(ProdCode, 2) = '5P' or left(ProdCode, 2) = '6P' or left(ProdCode, 2) = '8P' or left(ProdCode, 2) = '9P','Parts',

      if(left(ProdCode, 2) = '1O' or left(ProdCode, 2) = '2O' or left(ProdCode, 2) = '3O' or left(ProdCode, 2) = '4O' or

      left(ProdCode, 2) = '5O' or left(ProdCode, 2) = '6O' or left(ProdCode, 2) = '8O' or left(ProdCode, 2) = '9O','Obsolete',

      if(left(ProdCode, 2) = '1M' left(ProdCode, 2) = '2M' or left(ProdCode, 2) = '3M' or left(ProdCode, 2) = '4M' or

      left(ProdCode, 2) = '5M' or left(ProdCode, 2) = '6M' or left(ProdCode, 2) = '8M' or left(ProdCode, 2) = '9M,'NonStock Svc',

      if(left(ProdCode, 2) = '1S' left(ProdCode, 2) = '2S' or left(ProdCode, 2) = '3S' or left(ProdCode, 2) = '4S' or

      left(ProdCode, 2) = '5S' or left(ProdCode, 2) = '6S' or left(ProdCode, 2) = '8S' or left(ProdCode, 2) = '9S','Ship',

      if(left(ProdCode, 2) = '1T' left(ProdCode, 2) = '2T' or left(ProdCode, 2) = '3T' or left(ProdCode, 2) = '4T' or

      left(ProdCode, 2) = '5T' or left(ProdCode, 2) = '6T' or left(ProdCode, 2) = '8T' or left(ProdCode, 2) = '9T','Loaners',

      'Misc'))))))) as ProdGroup

       

      Thanks for the Help,