Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ilanbaruch
Specialist
Specialist

iterno on non date field

hi all

in my model i have a table with list of stores , period_id as from and max_period_id as to 

i want to add rows to each store in the list and add +1 to period_id i.e

store nameperiod_idmax_period_id 
Store A2126exist
Store A2226need to be added
Store A2326need to be added
Store A2426need to be added
Store A2526need to be added
Store A2626need to be added

 

tried it with :

from + IterNo() - 1 as new_period

while from + IterNo() - 1 <= to

 

but did not succeed ..

any ideas 

 

advanced thanks

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

Seems to work for me

Table:
LOAD [Store Name],
	 from + IterNo() - 1 as new_period
While from + IterNo() - 1 <= to;
LOAD * INLINE [
    Store Name, from, to
    Store A, 21, 26
];

image.png

View solution in original post

3 Replies
Kushal_Chawda

Can you provide sample input data with expected output?

sunny_talwar

Seems to work for me

Table:
LOAD [Store Name],
	 from + IterNo() - 1 as new_period
While from + IterNo() - 1 <= to;
LOAD * INLINE [
    Store Name, from, to
    Store A, 21, 26
];

image.png

ilanbaruch
Specialist
Specialist
Author

you are right. it was a number formatting issue.

thank you