Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewalex
Contributor III
Contributor III

reshape table scripting

Hi,

I load a Table.

Tasks:

LOAD [Object-ID],

     Key,

     start,

     end

FROM

test.xlsx

(ooxml, embedded labels, table is table1);

This Table looks like this:

keystartend
K12.1.20163.1.16
K21.1.20165.1.16
K37.1.20167.1.16
K45.1.20168.1.16

now I need a table with only one date and all the keys of the tasks that are open on that day.

The first day should be the first start day. The last day should be today.


The condition is:

date >= start and date < end


And I need a 3. column with the Information "open"


So my example should look like this:

DateKeystatus
1.1.16K1open
2.1.16K1open
2.1.16K2open

3.1.16

K2open
4.1.16K2open
5.1.16K4open
6.1.16K4open
7.1.16K4open

Unfortunately, I have no idea how I can do this reshaping.


I hope someone can help me.


Alex

1 Solution

Accepted Solutions
sunny_talwar

I think the sample output you have provided isn't correct, or may be I am missing something here. See if this is right

Capture.PNG

Table:

LOAD key,

  Date(start + IterNo() - 1) as Date,

  'Open' as Status

While start + IterNo() - 1 < end;

LOAD key,

    start,

    end

FROM

[https://community.qlik.com/thread/230851]

(html, codepage is 1252, embedded labels, table is @1);

View solution in original post

2 Replies
sunny_talwar

I think the sample output you have provided isn't correct, or may be I am missing something here. See if this is right

Capture.PNG

Table:

LOAD key,

  Date(start + IterNo() - 1) as Date,

  'Open' as Status

While start + IterNo() - 1 < end;

LOAD key,

    start,

    end

FROM

[https://community.qlik.com/thread/230851]

(html, codepage is 1252, embedded labels, table is @1);

qlikviewalex
Contributor III
Contributor III
Author

Thanks.

It works well.