Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Customize sort order

Hi,

I try to use Load Inline (shows as below) to create the customized sort value of "Report Type" in table B.

   

However, I want to connect table B with another table A with "Case ID" as the primary key. I also want to add data field "Case Date" in table B.

My question is can I add "Case ID" and "Case Date" in table B? If so, where I should place them?

It shows error if I do this:

Load

       Case ID,

       Case Date

Inline [

Report Type

    Spontaneous

    Report from Study

    Others

];

Thanks in advance,

Becky

1 Solution

Accepted Solutions
swuehl
MVP
MVP

If you want to set a specific load order for Report Type to determine the sort order by using sort option 'load order', all you have to do is use the INLINE LOAD before you are loading your Report Type fields in any other table LOAD.

I assume you have another table with Report Type, Case ID and Case Date, so just do this:

Dummy:

LOAD * INLINE [

Report Type

...

];

FactTable:

LOAD [Case ID],

          [Case Date],

          [Report Type],

          ...

FROM YourTableSource;

DROP TABLE Dummy;

View solution in original post

6 Replies
sunny_talwar

How is Case ID and Case Date related to Report Type?

swuehl
MVP
MVP

If you want to set a specific load order for Report Type to determine the sort order by using sort option 'load order', all you have to do is use the INLINE LOAD before you are loading your Report Type fields in any other table LOAD.

I assume you have another table with Report Type, Case ID and Case Date, so just do this:

Dummy:

LOAD * INLINE [

Report Type

...

];

FactTable:

LOAD [Case ID],

          [Case Date],

          [Report Type],

          ...

FROM YourTableSource;

DROP TABLE Dummy;

Not applicable
Author

Thanks so much. It works. And easy for me to understand how to use it.

swuehl
MVP
MVP

You are welcome.

Just remember that load order is determined by the first appearance of a field value during your script execution.

And that we are talking about field values, not table records, so if your field is a key field (like in the sample above) both table loads need to be considered to determine the load order (that's what we benefit from when using an INLINE LOAD first in the script).

Not applicable
Author

Thank you again for adding this helpful note.

a2dr37ao
Partner - Contributor II
Partner - Contributor II

@swuehl tks for this example that today help me so much.

@Lisa_P  I believe that this post can teache us more aboute load order.