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: 
Vaati
Contributor
Contributor

Generate missing rows of data in load script (above and below column segments)

Hello , 

I have this flattened table from previously loaded json tables. My requirement is to insert rows before and after each column segment ; above to insert a row with a specific timestamp that i already have in a resident table,and below to insert another with a function such as today() or now(), and as a third requirement to insert in the below row a value from above row but from a different column. I'm getting stuck in the process of iterating through these segments.  Could anyone point me in the right direction? 

Event IDName            Timestampfrom Valueto Value
 TiqPrev table date'Origin' 
1Tiq01/01/2020AB
2Tiq03/01/2020BC
 Tiqtoday()C 
 DdaPrev table date'0rigin' 
3Dda15/01/2020AB
4Dda03/01/2020BC
5Dda06/01/2020CA
6Dda08/01/2020AD
 Ddatoday()D 
 PicPrev table date'Origin' 
7Pic13/02/2020AC
8Pic15/02/2020CD
9Pic24/04/2020DA
 Pictoday()A 

 

With black colour i'm showing what data i have so far, and with green what i need to be inserted for each segment of 'Name' field. 'Origin' string will remain the same for all rows created above each segment, whereas 'D' for example is dependent on previous row shifted by 1 column; so the value for the row under should take the value of the previous row shifted by 1 column.

Mention: the table is Ordered by name and within the segment by timestamp as a general rule

Thanks in advance.

 

Labels (5)
1 Reply
Vaati
Contributor
Contributor
Author

I solved it in the end. If anyone needs to know for this specific case drop a reply