Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have one requirement my case is getting refers to multiple department and I wanted to show them into a single row.For e.g
If I have attended class A then it will show as 'YES' and then I moved to Class B then it will show 'YES' and I was not there in class C,D and E so it will pickup 'NO' .
In other scenario suppose I was present in A,C,D and E then it will show 'YES' and for B it will show 'NO' and so..on.
Now my concern is that here am getting multiple rows for single Roll_No .I wanted to show the O/P in single row with all combination of 'YES' & 'NO' If will go for IF statement it will create a essay of code which I don't wanna prefer and i don't know will it be feasible or not.
PFA
Regards,
KK
Expected result? And where you want to try this, I meant in script/UI??
PFA expected O/P file and I wanted to do this in Script;
Does Second scenario is subsequent of First scenario?
NO its not subsequent both are inter related.
If you were open to UI approach (i see you did mention leaning to script), maxstring() and straight table should work. but only so long as 'Yes' & 'No' sort. (if the example changed strings, then adaptation would be needed)
No Evan I need this at script level will try some approach
The premise is pretty much the same, noconcatenate and dropping the original table unconfused the matter.
[UNGROUPED]:
LOAD * INLINE [
Roll_No, A, B, C, D, E
40608, No, No, No, No, No
40608, No, No, Yes, No, No
40608, Yes, No, No, No, No
];
[GROUPED]:
NOCONCATENATE LOAD Roll_No, MaxString(A) AS A,MaxString(B) AS B,MaxString(C) AS C,MaxString(D) AS D,MaxString(E) AS E
RESIDENT UNGROUPED GROUP BY Roll_No;
DROP TABLE UNGROUPED;
Sorry, For late reply, I missed out this thread.
So, Once if you are not there in the list for each subject you should've pick where you attended which called "Yes" it it?
Please let us know if you found solution. dont make along for this thread