Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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
MVP
MVP

Re: Customize sort order

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;

5 Replies
MVP
MVP

Re: Customize sort order

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

MVP
MVP

Re: Customize sort order

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

Re: Customize sort order

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

MVP
MVP

Re: Customize sort order

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

Re: Customize sort order

Thank you again for adding this helpful note.

Community Browser