Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
suzel404
Creator
Creator

How can I generate days between differents type ?

Hi all,

How can I generate all days between differents TYPE_ID ?

STORE_ID      STATE_ID   TYPE_ID   DATE_START   DATE_END

ST00111001/01/201508/01/2015
ST00114508/01/201512/01/2015
ST00116012/01/201522/02/2015
ST001210022/02/201502/03/2015
ST001210102/03/201508/03/2015
ST001210208/03/201515/03/2015
ST001420015/03/201525/03/2015
ST001421025/03/201531/03/2015
ST001422031/03/201505/04/2015
ST001530005/04/201520/04/2015
ST001673020/04/201517/05/2015
ST001673517/05/201522/05/2015
ST001790022/05/201528/05/2015
ST001880228/05/201513/06/2015
ST001880513/06/201518/07/2015
ST001970018/07/2015-

I want to generate all days between differen TYPE_ID until TYPE_ID <> 9

How can I achieve it ?

Many thanks for your help.

Regards

1 Solution

Accepted Solutions
Not applicable

As per my understanding you need to generate the all date between DATE_START and DATE_END.

Please find the below:

Source:

Load

     STORE_ID,

      STATE_ID,

      TYPE_ID,

      DATE_START,

      DATE_END

From source_Table;

Final:

LOAD

     STORE_ID,

      STATE_ID,

      TYPE_ID,

      DATE_START + IterNo() - 1 AS Date_ID

Resident Source

Where Not Isnull(DATE_END)

While iterNo() <= (DATE_END - DATE_START)+1

;

View solution in original post

4 Replies
sunny_talwar

Not sure I understand what the required output is, can you please elaborate

Not applicable

As per my understanding you need to generate the all date between DATE_START and DATE_END.

Please find the below:

Source:

Load

     STORE_ID,

      STATE_ID,

      TYPE_ID,

      DATE_START,

      DATE_END

From source_Table;

Final:

LOAD

     STORE_ID,

      STATE_ID,

      TYPE_ID,

      DATE_START + IterNo() - 1 AS Date_ID

Resident Source

Where Not Isnull(DATE_END)

While iterNo() <= (DATE_END - DATE_START)+1

;

suzel404
Creator
Creator
Author

Hi Sunny,

I want to generate a master calendar with all days between TYPE_ID

Generate all day from 01/01/2015 to 12/01/2015 until TYPE_ID <> 9.

When I click on ST001 and state = 1 and type_id = 10 I can see all days from 01/01/2015 to 08/01/2015 and for each type_id.

ST00111001/01/201508/01/2015
ST00114508/01/201512/01/2015
suzel404
Creator
Creator
Author

Many thanks for help.

Thanks dathu.qv