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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

split column fields into two column using tmap

Hi
I have two types of file names in column "File" with datatype String
First : A.csv.bad.currentdate
Second: A.csv.good.currentdate
I want to split these filenames into two column, Good and Bad
So from tmap output, would be like this
Good                                          Bad
A.csv.good.currentdate               A.csv.bad.currentdate
may I know how I can I set up this config in tmap ?
Labels (2)
8 Replies
Anonymous
Not applicable
Author

Can anyone Help ?
Anonymous
Not applicable
Author

Write a small piece of Java code to cut the string, for example, 
the expression for the good string:
row1.data.substring(row1.data.lastIndexOf(":")+1)
the expression for the bad string:
row1.data.substring(row1.data.IndexOf(":")+1,row1.data.indexOf("\r\n"))
Anonymous
Not applicable
Author

Hey Shong
Here is my output....Please check
http://prntscr.com/9px09l

I want to split "File" Column into two columns, "Bad" and "Read".
So output would be like this
http://prntscr.com/9px2hy

May I know how can I do this in Tmap ?
Anonymous
Not applicable
Author

Hey Shong, Can you suggest me for the same ?
Anonymous
Not applicable
Author

Anyone ?
Anonymous
Not applicable
Author

Hi 
Use a tMap to generate two output tables, add a filter condition to filter the reject rows for reject table or bad rows for bad table, for example:
row1.file.contains("bad")
Add a sequence id for each table for doing join in the next subjob to merge the bad and reject columns, see
0683p000009MCxa.png 0683p000009MCxf.png 0683p000009MCxk.png
Hope it helps.
Anonymous
Not applicable
Author

I have to split the val from this file to two separate files, where 1st file file contains 1,2,3 and 2nd file contains 15,25,34. 

dist        val

A

              1

              2 

              3

B

              15

              25

              34

 

how do I do this?

Can somebody help me?

 

 

Anonymous
Not applicable
Author

Hi Shong can you help me?