Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ckandemir
Contributor
Contributor

Iterno()

Hi Everyone,

I have ID, Start_Date and End_Date variables. I want to use Iterno() function to expand my table like table below.

Can anybody explain that how I can do that?

My table;

IDStart_DateEnd_Date
11.01.20203.01.2020
210.01.202012.01.2020
326.01.202027.01.2020

 

My result That I want;

IDDate
11.01.2020
12.01.2020
13.01.2020
210.01.2020
211.01.2020
212.01.2020
326.01.2020
327.01.2020
Labels (1)
2 Solutions

Accepted Solutions
Vegar
MVP
MVP

Try this script:

 

SET DateFormat='D.MM.YYYY';
Load 
  ID,
  dayname(Start_Date - 1 + IterNo()) as Date
Inline [
  ID, Start_Date,End_Date
  1, 1.01.2020, 3.01.2020
  2, 10.01.2020, 12.01.2020
  3, 26.01.2020, 27.01.2020]
While
   Start_Date - 1 + IterNo() <= End_Date
;

View solution in original post

sunny_talwar

Try this

Table:
LOAD ID,
	 Date(Start_Date + IterNo() - 1) as Date
While Start_Date + IterNo() - 1 <= End_Date;
LOAD * INLINE [
    ID, Start_Date, End_Date
    1, 1.01.2020, 3.01.2020
    2, 10.01.2020, 12.01.2020
    3, 26.01.2020, 27.01.2020
];

View solution in original post

4 Replies
Vegar
MVP
MVP

Try this script:

 

SET DateFormat='D.MM.YYYY';
Load 
  ID,
  dayname(Start_Date - 1 + IterNo()) as Date
Inline [
  ID, Start_Date,End_Date
  1, 1.01.2020, 3.01.2020
  2, 10.01.2020, 12.01.2020
  3, 26.01.2020, 27.01.2020]
While
   Start_Date - 1 + IterNo() <= End_Date
;

sunny_talwar

Try this

Table:
LOAD ID,
	 Date(Start_Date + IterNo() - 1) as Date
While Start_Date + IterNo() - 1 <= End_Date;
LOAD * INLINE [
    ID, Start_Date, End_Date
    1, 1.01.2020, 3.01.2020
    2, 10.01.2020, 12.01.2020
    3, 26.01.2020, 27.01.2020
];
Vegar
MVP
MVP

It looks like I and @sunny_talwar  agrees on how to solve this. 

sunny_talwar

Yes we do 🙂