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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Karuetl
Creator II
Creator II

Split into multiple files based on Date Value from Source

need help to achieve that We are source records with different dates  and want to split into different files based on the month of those dates 

 

Example 

I have input data from source table as below

 

 

Col1 Col2 Col3
--------------------------
abc newyork  2018-10-15
abc newjersey 2018-10-12
abc newyork   2018-11-15
abc newyork   2018-12-06

Output should have 3 files 

 

 

one for Month 201810

 

abc newyork  2018-10-15
abc newjersey 2018-10-12

one for Month 201811

abc newyork   2018-11-15

one for Month 201812

abc newyork   2018-12-06

 

Labels (2)
1 Solution

Accepted Solutions
akumar2301
Specialist II
Specialist II

4 Replies
akumar2301
Specialist II
Specialist II

read file --> tjavarow ( set global var like filenameYYYYmm with yyyymm of last col --> output file ( filename should be globalvar (filenameYYYYmm ) append mode.

this should work
vapukov
Master II
Master II

I afraid - this is will not work

filename defined before subjob start

 

need insert tFlowToIterate which could define and filename and store row into memory (hash or variables) and 2nd subjob - read data and append them to file 

akumar2301
Specialist II
Specialist II

Thanks @Vapulkov ,

you are right . I did not thought about it.

I was ablr to do it with below steps

Read file -- > add col4 which in YYYYMM format of Col3(TjavaRow) --> file uniq on col4 in ( tUniqRow) -- > tflowtoItrate( put col4 in GlobalVar) --> read file again --> tFilterRow on GlobalVar --> tFilerOutPut ( Filename based on globalVar)

we could use tHashINput/output if we do not want to read files multiple time.
akumar2301
Specialist II
Specialist II

0683p000009M1U7.jpg