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: 
datanibbler
Champion
Champion

"Piggyback LOAD": Is the table sorted?

Hi,

I want to build sth. like the following

Presence_data:

LOAD

      *,

      IF(Pers_ID = PREVIOUS(Pers_ID), 1, 0)

;

LOAD

    %Date,

    Pers_ID

  ...

RESIDENT ...

ORDER BY Pers_ID asc, %Date asc

;

For the PREVIOUS() fct to work correctly and return me a proper 1/0 field that I can sum up in the chart, it is essential that the table be already sorted by these two fields.

=> Will this work in this way? Can I rely on the table being already sorted when I use such a "piggyback LOAD"?

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Seems to work for me:

X1:

load * inline [

A,B

3,t

2,g

5,b

6,f];

X2:

load *, if(previous(A)=3,1,0) as C;

load * resident X1

order by A;

drop table X1;

But it works just fine without the preceding load too.

X1:

load * inline [

A,B

3,t

2,g

5,b

6,f];

X2:

load *, if(previous(A)=3,1,0) as C

resident X1

order by A;

drop table X1;


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Seems to work for me:

X1:

load * inline [

A,B

3,t

2,g

5,b

6,f];

X2:

load *, if(previous(A)=3,1,0) as C;

load * resident X1

order by A;

drop table X1;

But it works just fine without the preceding load too.

X1:

load * inline [

A,B

3,t

2,g

5,b

6,f];

X2:

load *, if(previous(A)=3,1,0) as C

resident X1

order by A;

drop table X1;


talk is cheap, supply exceeds demand
datanibbler
Champion
Champion
Author

Thanks Gysbert!

I will try.

datanibbler
Champion
Champion
Author


Hi Gysbert,

seems to be working.

That helps me a great deal for now I can use for my employee_presence_chart the same dimension as for most others, which is "Mo - Sat", thereby overcoming a mayor shortcoming of our personell_database.

Thanks a lot!

Best regards,

DataNibbler