Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Colleagues, good day!
Working in QV script with order by operator show me some strange result when i try concat several fields.
I have one table:
Field1 | Field2 | Field3 | Field4 |
1 | 1 | A | 3 |
2 | 2 | B | 5 |
1 | 3 | B | 4 |
2 | 4 | B | 3 |
1 | 5 | B | 4 |
4 | 6 | D | 4 |
1 | 7 | D | 4 |
1 | 1 | A | 3 |
2 | 2 | B | 5 |
1 | 3 | B | 4 |
4 | 4 | f | 3 |
1 | 5 | s | 4 |
4 | 6 | D | 4 |
1 | 7 | D | 4 |
And i need to get final result by concat:
Test:
LOAD *
FROM
Sorting.xlsx
(ooxml, embedded labels, table is Лист1);
test2:
load
Field1&Field2&Field3&Field4
Resident Test Order by Field3, Field2, Field1;
DROP Table Test;
Result table must be:
11A3 |
11A3 |
22B5 |
22B5 |
13B4 |
13B4 |
24B3 |
15B4 |
46D4 |
46D4 |
17D4 |
17D4 |
44f3 |
15s4 |
Could anyone explain why sorting operator works so strangely?
Thanks.
And unload in QVD
Test:
LOAD *
FROM
Sorting.xlsx
(ooxml, embedded labels, table is Лист1);
test2:
load
Field1&Field2&Field3&Field4
Resident Test Order by Field3, Field2, Field1;
DROP Table Test;
Store * from test2 into xyz.qvd;
Result
Regards,
Andrey
Hi Andrey,
In your internal table of all it is the way you want.
Settings object of sheet the (a simple table) give you a different view of the data.
Regards,
Andrey
thanks, but my question was how to do it in load script, because final result must be save to qvd file.
I think you are getting the result you are looking for...
I added a counter using RowNo() function
Test:
LOAD *
FROM
Sorting.xlsx
(ooxml, embedded labels, table is Лист1);
test2:
LOAD RowNo() as RecNo,
Field1&Field2&Field3&Field4
Resident Test Order by Field3, Field2, Field1;
DROP Table Test;
Thanks, but in qvd i need to store only Field1&Field2&Field3&Field4 without RecNo.
Will it save sorting?
And unload in QVD
Test:
LOAD *
FROM
Sorting.xlsx
(ooxml, embedded labels, table is Лист1);
test2:
load
Field1&Field2&Field3&Field4
Resident Test Order by Field3, Field2, Field1;
DROP Table Test;
Store * from test2 into xyz.qvd;
Result
Regards,
Andrey
I think it should... I don't see why it wouldn't
Thanks.
Of course, it works correctrly in the end of load..
I forgot to uncheck standard A-Z sorting in stright table
Thanks!