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: 
Anonymous
Not applicable

split first 3 rocords to one target and last 3 into another

Hi All , 

I have a Table of 6 records , I need to make 2 targets and first 3 rows will go into target 1 and last 3 rows will move into target 2 . 

I dont want it in even/ odd format with "%2" operation. .

 

Thanks in advance .

 

Regards 

Subhadeep

Labels (2)
5 Replies
TRF
Champion II
Champion II

Using a tMap you may have a sequence to count records then, having 2 output flows with the appropriate filters you can separate 3 first records from 3 last.
Anonymous
Not applicable
Author

I am not able to find the proper filter condition inside tMap.

Can you please send me the solution for the same ?

Thanks
Subhadeep
TRF
Champion II
Champion II

Define a local variable such as "count" into your tMap. Then on rhe 1rst output flow, define the filter line this: "Var.count <= 3" and for this other one: "Var.count > 3"
ankit7359
Creator II
Creator II

Hi @ADee,

Greetings of the day,

Well your scenario can be acheived in Tmap by using sequence number function and for this -

i) add a column by name id or something to uniquely define your column and then write a function in the expression builder Numeric.sequence("s1",1,1) and then you can apply filter for spliting the records.

ii)you can try using another component to explore - tsamplerow.

If you are still facing issues,Pls reach out to the Community.

Thanks,

Ankit

TRF
Champion II
Champion II

@ADee to complete my first posts, here is what your tMap should look like:

0683p000009M17h.pngThen if you push these flows to 2 tLogRow components, here is the result:

[statistics] connecting to socket on port 3799
[statistics] connected
.----.
|tLogRow_2|
|=--=|
|Col1|
|=--=|
|1   |
|2   |
|3   |
'----'

.----.
|tLogRow_3|
|=--=|
|Col1|
|=--=|
|4   |
|5   |
|6   |
'----'
[statistics] disconnected