Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
phb_nostromo
Contributor III
Contributor III

Hi .. I am stuck !! Please Create extra lines in a script

I would like to reach the following result from that type of data.

Simply to be able to create extra lines when a a task ( DutyMinutes ) has to be repeated over a few weeks.

for instance, the third line will have two lines as a result as  it covers weeks 25 and 26 of 2017.

I tried to use peek in resident table but got totally lost !

Any help please ?

 

EmployeeDutyMinutesWeekStartWeekEnd
S. BOLlQUIER20201724201724
S. BOLlQUIER15201725201725
S. BOLlQUIER20201725201726
S. BOLlQUIER35201726201728
EmployeeDutyMinutesWeek
S. BOLlQUIER20201724
S. BOLlQUIER15201725
S. BOLlQUIER20201725
S. BOLlQUIER20201726
S. BOLlQUIER35201726
S. BOLlQUIER35201727

S. BOLlQUIER35201728
1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Philippe,

Data:

LOAD * INLINE [

    Employee, DutyMinutes, WeekStart, WeekEnd

    S. BOLlQUIER, 20, 201724, 201724

    S. BOLlQUIER, 15, 201725, 201725

    S. BOLlQUIER, 20, 201725, 201726

    S. BOLlQUIER, 35, 201726, 201728

];

Result: 

LOAD 

  Employee,

  DutyMinutes, 

  WeekStart + IterNo() -1 as Week  

Resident Data 

While WeekStart + IterNo()-1 <= WeekEnd;

DROP Table Data;

View solution in original post

3 Replies
tamilarasu
Champion
Champion

Hi Philippe,

Data:

LOAD * INLINE [

    Employee, DutyMinutes, WeekStart, WeekEnd

    S. BOLlQUIER, 20, 201724, 201724

    S. BOLlQUIER, 15, 201725, 201725

    S. BOLlQUIER, 20, 201725, 201726

    S. BOLlQUIER, 35, 201726, 201728

];

Result: 

LOAD 

  Employee,

  DutyMinutes, 

  WeekStart + IterNo() -1 as Week  

Resident Data 

While WeekStart + IterNo()-1 <= WeekEnd;

DROP Table Data;

phb_nostromo
Contributor III
Contributor III
Author

Hi Tamil !

Thanks a lot works like a Wonder .

have a nice day

tamilarasu
Champion
Champion

Great. You too have a fantastic day, Philippe.