Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have data like this below (in Resident table);
ARTIKELLOPNR, ARTIKELID, EANColor, EANSize, EANKOD, RN
1111 A Black L 11111 1
1111 A Black L 12121 2
1111 A White L 34343 1
1111 A White L 55555 2
2222 B Black M 66666 1
2222 B Black M 77777 2
3333 C Red S 65766 1
4444 D Red XL 34321 1
.....
I need this format (with QV script);
ARTIKELLOPNR, ARTIKELID, EANColor, EANSize, EANKOD1, EANKOD2
1111 A Black L 11111 12121
1111 A White L 34343 55555
2222 B Black M 66666 77777
3333 C Red S 65766 65766
4444 D Red XL 34321 34321
...
every ARTIKELLOPNR & ARTIKELID & EANColor & EANSize must be one line in table.
Thanks
Murat
Maybe like this:
Result: LOAD ARTIKELLOPNR, ARTIKELID, EANColor, EANSize, Only(If(RN = 1, EANKOD)) as EANKOD1, Alt(Only(If(RN = 2, EANKOD)),Only(If(RN = 1, EANKOD))) as EANKOD2 Resident Table
GROUP BY ARTIKELLOPNR, ARTIKELID, EANColor, EANSize; DROP TABLE Table;
//testing posting a reply on the new platform for the first time,
Stefan -
How did you get a box around the script?
Thanks,
Sunny
In the rich text menu, there is a tag for code block </>.
Thanks Stefan!!
Hi,
if you don't need the redundant EANKOD2 in case there is only one row, then maybe a generic load might do as well:
table1: Generic LOAD ARTIKELLOPNR, ARTIKELID, EANColor, EANSize, 'EANKOD'&RN, EANKOD Inline [ ARTIKELLOPNR, ARTIKELID, EANColor, EANSize, EANKOD, RN 1111, A, Black, L, 11111, 1 1111, A, Black, L, 12121, 2 1111, A, White, L, 34343, 1 1111, A, White, L, 55555, 2 2222, B, Black, M, 66666, 1 2222, B, Black, M, 77777, 2 3333, C, Red, S, 65766, 1 4444, D, Red, XL, 34321, 1 ];
hope this helps
regards
Marco
Well, you could just load new table with distinct statement resident from this one without last field