Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
datanibbler
Esteemed Contributor

"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

Re: "Piggyback LOAD": Is the table sorted?

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
3 Replies

Re: "Piggyback LOAD": Is the table sorted?

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
Esteemed Contributor

Re: "Piggyback LOAD": Is the table sorted?

Thanks Gysbert!

I will try.

datanibbler
Esteemed Contributor

Re: "Piggyback LOAD": Is the table sorted?


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

Community Browser