4 Replies Latest reply: Jun 11, 2018 5:17 PM by Mark Pratt RSS

    Invalid Expression Help

    Mark Pratt

      Here is the part I am getting the error on:

       

      Attached:

       

       

      LOAD "Card_Number",

          "Attached_Account_Type",

          "Attached_Account_Number";

      SQL SELECT "Card_Number",

          "Attached_Account_Type",

          "Attached_Account_Number"

      FROM XXXXXXXXXXXXXXXXXX;

       

      Attached2:

       

      Load "Card_Number",

      if(count(distinct if(Attached_Account_Type=1,Attached_Account_Number))=2 and Max(Attached_Account_Number)=Attached_Account_Number, Attached_Account_Number,

          if(Attached_Account_Type=1,Attached_Account_Number)) as "Checking 1",

          if(count(distinct if(Attached_Account_Type=2,Attached_Account_Number))=2 and Max(Attached_Account_Number)=Attached_Account_Number, Attached_Account_Number,

          if(Attached_Account_Type=2,Attached_Account_Number)) as "Savings 1",

          if(count(distinct if(Attached_Account_Type=1,Attached_Account_Number))=2, Min(Attached_Account_Number)) as "Checking 2",

          if(count(distinct if(Attached_Account_Type=2,Attached_Account_Number))=2, Min(Attached_Account_Number)) as "Savings 2"

      Resident [Attached]

      Group by [Card_Number];

      Drop Table [Attached];

       

      Basically I could have up to 2 checking and/or 2 savings tied to a single card and would like to separate out into Checking 1&2 and Savings 1&2. Help please!