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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
SIrving1689772775
Contributor
Contributor

How do I create a file with header, section and details

I have an input with multi lines with a structure where  C1,C2,C3 have to have different levels of output and computed values like.

canada,ontario,toronto,25

canada,ontario,chatham,32

canada,quebec,montreal,5

USA,michican,detroit,3

There can be one or more records at each stage but I need to be able to create a header record for each entry in C1, the create a summary header for each C2 and then details for each C3.  There are various counters, sums etc.

Since there are so many components I just can't figure out which one I need to use to separate the structures.  For example something like component that grabs all same C1, passes rows to new processes that grab all rows of same C2 which then passes those rows to a new process that does the details.

In code it would be like.

w1=null
read line,

if c1=w1

 process some code with values,sums etc

 set w1=c1

else call level2

read new line

end

Level2 would be similar but look at changes in c2 and do some work and call level3 on its changes.

So in short I am looking for a component that will give me rows where C1 is the same so I can pass it to my next set of tasks.  Those tasks would run a similar component on those records passed to it and then pass those records to a third set of tasks.

Each set must have a header and footer with different info so I just can't use the same mapper.  I can probably figure out with variables and stuff how to get all the data and output it in the proper order but just stuck on how to separate it into workable sections.  

 

Labels (1)
0 Replies