Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

binary load and order by

Hi guys,

i am doing binary load of my data model in my report qvw.

i want to do "order by" operation on the table which has come as part of binary load in my report qvw but it does not work.

Is there any relation between binary load and order by?

Binary data.qvw;

Txn:

Load * resident Tmp_Txn

where isnull(IsInvTable)

order by TxnId, TxnDate;

The Tmp_Txn has come from binary load.

the "where" clause works but 'order by" has no effect.

Am i missing anything here?

Saurabh

22 Replies
alexandros17
Partner - Champion III
Partner - Champion III

It should work,

try to order in your original document (the one you load into the second) and verify if it works!

Not applicable
Author

it works if i do order by in the original one but i can not do it there because i need to binary load this file in many different report qvws and all have different requirements.

hic
Former Employee
Former Employee

The Order By works fine, also with a Binary load. However, there is a trap...

If you do a

   Load TxnId, TxnDate Resident ... Order By TxnId, TxnDate;

then the data table will be sorted correctly, but the symbol tables will not change: The old ones will be used. This means that "Sort by load order" in the UI will not be affected by the Order By.

But if you instead do a

   Load TxnId as NewID, TxnDate as NewDate Resident ... Order By TxnId, TxnDate;

then both data tables and symbol tables will be new and sorted according to your demand.

See more on http://community.qlik.com/blogs/qlikviewdesignblog/2012/11/20/symbol-tables-and-bit-stuffed-pointers

HIC

Not applicable
Author

i am going to try this...

few questions...

do i need to rename all columns or just those on which i am doing order by?

so after renaming these columns will be available with new name...is it right?

hic
Former Employee
Former Employee

You need to rename the fields that you want re-ordered.

HIC

Not applicable
Author

Here is my old script

Txn:

Load * resident Tmp_Txn

where isnull(IsInvTable)

order by TxnId, TxnDate;

New script

Load *, TxnId as NewID, TxnDate as NewTxnDate

where isnull(IsInvTable)

order by TxnId, TxnDate;

It is not working.

Do you think it is because of "*" used in the statement because it will bring TxnID and TxnDate as well along with NewID and NewTxnDate?

Saurabh

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Two questions.

1. Unless you specify "NoConcatenate", the

Load * resident Tmp_Txn

does not create a new table, correct?


2. Why do you want to do the order by? i.e. how will you use that order?


-Rob

Anonymous
Not applicable
Author

you try this

Txn:

noconcatenate

Load * resident Tmp_Txn

where isnull(IsInvTable)

order by TxnId, TxnDate;

drop table Tmp_Txn;

Not applicable
Author

I am doing NoConcatenate in my load script. It is not shown here

I need to order by because i need to show report in a certain order....in this case it is by TxnID and TxnDate