My apologies if this may have been answered already.
I’ve been trying to figure out how to use Excel to get around some shortcomings in an SQL querey I have to use to run some reports.
Basically, the SQL querey results include both missing AND redundant data.
For the sake of example, Column A includes Account Numbers, Column B is an “important account factor”, and Column C includes Usernames (belonging to the acct # in Column A).
Acct #,Acct factor,Username
1,b,jon
1,b,sam
1,null,sam
1,null,ben
1,null,tim
2,c,val
2,null,ted
2,c,ted
3,null,ned
3,null,ned
3,null,ken
3,null,liv
What I want the endpoint to be is the basically a lowest common denominator of Column A and Column B. I process Column C with a seperate function, but I need them for analytical context of Column A and B. Not all account numbers have account factors (in the absence of a factor in any “Acct factor” field for any given “Acct #”, null is the valid state). I need to display the appropriate “Acct factor” state for each account number.
This is what I’d want to get out of the above data when all is said and done:
Acct #,Acct factor,Username
1,b,sam (or jon, ben, or tim, but only one)
2,c,val (or ted, but not both)
3,null,ned (or ken, or live, but only one)
This has been driving me CRAZY.
I hope you can help me.
Thanks in advance!