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

Adding an extra column to the delimited input file

Hi,
I download tab delimited files from an ftp server. The number of columns in the files vary and are between 5 and 15 columns. Some of the files are as below.
YAHOO_keyword_20101127.txt --- contains 5 columns
YAHOO_detail_20101127.txt --- contains 8 columns
I am using tInputFileDelimited to read these files and change the encoding and delimiter of the file and writing to another file using tOutputFileDelimited.
I would like to add another column to the file created by tOutputFileDelimited component. The extra column will be the date (20101127)in the name of the file itself.
Here is an example of what I need to do.
Input File:
col1 col2 col3 col4 col5
a b c d e
b c d e a
Output File wanted:
col1 col2 col3 col4 col5 date_created
a b c d e 20101127
b c d e a 20101127
The date value comes from the file itself.
I would really appreciate if someone can help me with this. I was also trying to use the tmap component but was not able to achieve what I described above.
Thank you,
Santhosh.
Labels (2)
29 Replies
Anonymous
Not applicable
Author

where status is new column which I have to create.
how to do it?
Inside output column you can write expression
input_row.marks < 35 ?"30%" 0683p000009MPcz.pnginput_row.marks > 35 & input_row.marks < 50)?"50%":some condition
This is cascaded if-then-else
previous column output = input column for that column, take that directly...
Thanks
vaibhav
soujanyam
Contributor
Contributor

previous column output = input column for that column, take that directly.
When I'm using that directly it is showing me as error.
Anonymous
Not applicable
Author

Something is wrong... can you show the screenshot of tMap..
soujanyam
Contributor
Contributor

Sorry I could not able to add the screenshots.
Anonymous
Not applicable
Author

Use Post reply and keep the size of your screenshot as per their instruction... now it is very simple..
Click and paste your screenshot..

vaibhav
soujanyam
Contributor
Contributor

Sorry I could not get to attach screenshot.
soujanyam
Contributor
Contributor

I'm getting error when there is no mappaing to the new column which I've created in output columns and adding expression.
Anonymous
Not applicable
Author

That is not an issue, can you show the expression used in additional column?
vaibhav
soujanyam
Contributor
Contributor

Thanks for your reply Vaibav,
Example I'm using newcolumn=column5*100
where column5 is previous column in output.
Not only the multiplication I could not get any expression.It is showing me error as
  Newcolumn cannot be resolved or not a field.
Anonymous
Not applicable
Author

You must have added newcolumn in metadata in tMap output
- remove newcolumn= from expression and i assume that column5 is your name of previous column in metadata...
I am not sure why you can't display the screenshot of tMap, you can hide the fields if you have security issue... This way you can save time and efforts of many people.
thanks
vaibhav