Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Strange result in script sorting

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:

 

Field1Field2Field3Field4
11A3
22B5
13B4
24B3
15B4
46D4
17D4
11A3
22B5
13B4
44f3
15s4
46D4
17D4

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.

1 Solution

Accepted Solutions
ahaahaaha
Partner - Master
Partner - Master

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

1.jpg

Regards,

Andrey

View solution in original post

7 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi Andrey,

In your internal table of all it is the way you want.

1.jpg

Settings object of sheet the (a simple table) give you a different view of the data.

Regards,

Andrey

Anonymous
Not applicable
Author

thanks, but my question was how to do it in load script, because final result must be save to qvd file.

sunny_talwar

I think you are getting the result you are looking for...

Capture.PNG

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;

Anonymous
Not applicable
Author

Thanks, but in qvd i need to store only Field1&Field2&Field3&Field4  without RecNo.

Will it save sorting?

ahaahaaha
Partner - Master
Partner - Master

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

1.jpg

Regards,

Andrey

sunny_talwar

I think it should... I don't see why it wouldn't

Anonymous
Not applicable
Author

Thanks.

Of course, it works correctrly in the end of load..

I forgot to uncheck standard A-Z sorting in stright table

Thanks!