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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
aba57870
Contributor
Contributor

How to add buffer row(s) to file based on column value

I am trying to figure out how to go about converting a file with the following format

ID building room time

A main 12 10:00

A main 38 12:30

A office 8 3:00

B main 10 9:00

B office 6 11:00

into

A

main 12 10:00

main 38 12:30

office 8 3:00

**********

B

main 10 9:00

office 6 11:00

**********

...

So I need to format this file with the id for each original row to be a 'leading' row, then display the next x number of rows for each id containing the schedule, and finally 10 asterisks as a row to separate the schedules of each id. The headers don't necessarily matter as they wont be included, but I need my data to be formatted in this way.

Any help would be appreciated.

Labels (2)
2 Replies
gjeremy1617088143

0695b00000GiNQeAAN.jpg0695b00000GiNYNAA3.jpg0695b00000GiNXyAAN.jpg0695b00000GiNXtAAN.jpg0695b00000GiNP2AAN.jpg0695b00000GiNXoAAN.jpg0695b00000GiNLyAAN.jpg0695b00000GiNXeAAN.jpg0695b00000GiNXPAA3.jpg 

gjeremy1617088143

Hi, I use tfixedflowinput to simulate your file, you can use a tfileinput delimited with the same separator,

then I the first char of each row (A,B etc..) and the rest of the string witth substring,

I sorted the row by Id with tSortRow

then i denormalize the values to make a string array of the values for (A,B etc...)

I use a tflow to iterate , to iterate on A,B,C etc

then i use a trow generator to reatribuate the values in the iterate link.

Then i normalize the second column to make one row for each values wich are group y (A,B,C etc....)

then i use tjavaflex to format the string as the output you want.

And I stock everything in a globalMap here out.

Send me love and Kudos