Hi I have following data,
RecordID | Name | Value |
1 | od z_ritm | SD04567 |
1 | od z_aitm | SD33358 |
1 | od z_qna | 1 |
1 | z_aitm | SD09111 |
1 | z_qna | 1 |
1 | z_aitm2 | SD08111 |
1 | z_qna2 | 1 |
1 | z_aitm3 | DG00790 |
1 | z_qna3 | 1 |
1 | z_aitm4 | |
1 | z_qna4 | |
1 | z_aitm5 | |
1 | z_qna5 | |
1 | z_aitm6 | |
1 | z_qna6 | |
1 | Right_od z_aitm | SD09898 |
1 | Right_od z_qna | 0.3 |
1 | Right_z_aitm | |
1 | Right_z_qna | |
1 | Right_z_aitm2 | |
1 | Right_z_qna2 | |
2 | od z_ritm | SD04567 |
2 | od z_aitm | SD33358 |
2 | od z_qna | 1 |
2 | z_aitm | SD09111 |
2 | z_qna | 1 |
2 | z_aitm2 | SD08111 |
2 | z_qna2 | 1 |
2 | z_aitm3 | DG00790 |
2 | z_qna3 | 1 |
2 | z_aitm4 | |
2 | z_qna4 | |
2 | z_aitm5 | |
2 | z_qna5 | |
2 | z_aitm6 | |
2 | z_qna6 | |
2 | Right_od z_aitm | SD09899 |
2 | Right_od z_qna | 0.25 |
2 | Right_z_aitm | SD07777 |
2 | Right_z_qna | 1 |
2 | Right_z_aitm2 | |
2 | Right_z_qna2 |
Expected Output: I need to fill values up based on record id
RecordID | Name | Value |
1 | od z_ritm | SD04567 |
1 | od z_aitm | SD33358 |
1 | od z_qna | 1 |
1 | z_aitm | SD09111 |
1 | z_qna | 1 |
1 | z_aitm2 | SD08111 |
1 | z_qna2 | 1 |
1 | z_aitm3 | DG00790 |
1 | z_qna3 | 1 |
1 | z_aitm4 | SD09898 |
1 | z_qna4 | 0.3 |
1 | z_aitm5 | |
1 | z_qna5 | |
1 | z_aitm6 | |
1 | z_qna6 | |
1 | Right_od z_aitm | |
1 | Right_od z_qna | |
1 | Right_z_aitm | |
1 | Right_z_qna | |
1 | Right_z_aitm2 | |
1 | Right_z_qna2 | |
2 | od z_ritm | SD04567 |
2 | od z_aitm | SD33358 |
2 | od z_qna | 1 |
2 | z_aitm | SD09111 |
2 | z_qna | 1 |
2 | z_aitm2 | SD08111 |
2 | z_qna2 | 1 |
2 | z_aitm3 | DG00790 |
2 | z_qna3 | 1 |
2 | z_aitm4 | SD09899 |
2 | z_qna4 | 0.25 |
2 | z_aitm5 | SD07777 |
2 | z_qna5 | 1 |
2 | z_aitm6 | |
2 | z_qna6 | |
2 | Right_od z_aitm | |
2 | Right_od z_qna | |
2 | Right_z_aitm | |
2 | Right_z_qna | |
2 | Right_z_aitm2 | |
2 | Right_z_qna2 |
Hi @BRRLL99 ,
Here is one potential solution.
Workflow
Suggestion
I think there is a room for normalization in your table.
You may want to integrate those repetitive columns ("~aitm~" and "~qna~"), to make it First normal form ,
which will make your work easier. (e.g. The above struggle will not be necessary.)
Hi Thank you very much for the quick response
As per your workflow this is my result
But my expected output should be sequence number of previous column
RecordID | Name | Value |
1 | od z_ritm | SD04567 |
1 | od z_aitm | SD33358 |
1 | od z_qna | 1 |
1 | z_aitm | SD09111 |
1 | z_qna | 1 |
1 | z_aitm2 | SD08111 |
1 | z_qna2 | 1 |
1 | z_aitm3 | DG00790 |
1 | z_qna3 | 1 |
1 | z_aitm4 | SD09898 |
1 | z_qna4 | 0.3 |
1 | z_aitm5 | |
1 | z_qna5 | |
1 | z_aitm6 | |
1 | z_qna6 | |
1 | Right_od z_aitm | |
1 | Right_od z_qna | |
1 | Right_z_aitm | |
1 | Right_z_qna | |
1 | Right_z_aitm2 | |
1 | Right_z_qna2 | |
2 | od z_ritm | SD04567 |
2 | od z_aitm | SD33358 |
2 | od z_qna | 1 |
2 | z_aitm | SD09111 |
2 | z_qna | 1 |
2 | z_aitm2 | SD08111 |
2 | z_qna2 | 1 |
2 | z_aitm3 | DG00790 |
2 | z_qna3 | 1 |
2 | z_aitm4 | SD09899 |
2 | z_qna4 | 0.25 |
2 | z_aitm5 | SD07777 |
2 | z_qna5 | 1 |
2 | z_aitm6 | |
2 | z_qna6 | |
2 | Right_od z_aitm | |
2 | Right_od z_qna | |
2 | Right_z_aitm | |
2 | Right_z_qna | |
2 | Right_z_aitm2 | |
2 | Right_z_qna2 |
Reason I'm asking for same sequence number is my end result is to create this output using crosstab
od z_ritm | od z_aitm | od z_qna | z_aitm | z_qna | z_aitm2 | z_qna2 | z_aitm3 | z_qna3 | z_aitm4 | z_qna4 | z_aitm5 | z_qna5 | z_aitm6 | z_qna6 |
SD04567 | SD33358 | 1 | SD09111 | 1 | SD08111 | 1 | DG00790 | 1 | SD09898 | 0.3 | ||||
SD04567 | SD33358 | 1 | SD09111 | 1 | SD08111 | 1 | DG00790 | 1 | SD09899 | 0.25 | SD07777 | 1 |