Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
I think the problem is the unaggregated Attached_Account_Number field in your Attached2 table
That doesn't seem to help. I'm still getting the error. I also tried adding the adding Attached_Account_Type, which made a little more sense, but it didn't help either. Thanks!
Sorry, I thought they were the same fields, but there are two unaggregated fields
Attached_Account_Number
Attached_Account_Type
I ended up taking another approach and was able to achieve the desired results. Thanks for the help, though.