Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dmxmikey
Creator
Creator

Append text to end of csv output

I have a csv output from a load statement and would like to append the csv file by adding a row at the end of the csv file but cannot think of a way.

this is my load statement

Output:
Load
text([p-code]) as "Product code",
[con-group] as Customer,
'*ALL' as "Agreement code",
[consumer-desc] as Description,
[Unit_of_measure] as "Unit of measure",
[p-pack] as "Pack size",
[p-size] as "Pack size description",
[Variable_weight] as "Variable weight",
[Base_VAT_code] as "Base VAT code",
[com-desc] as Category,
ApplyMap('MAP-con-type',[con-type]) as "Contracted Price",
"act-date" as "From date",
PriceNew as Price

 

resident Temp;

Let vOutputfilename=Replace('Catalogue $(vContract) '&today()&'.csv','/','-');

Store Output into '$(vOutputfilename)' (txt);

 

 

 

1 Solution

Accepted Solutions
PrashantSangle

Hi,

 

As @lironbaram suggested you can concatenate extra line at end of output data.

Enhancing @lironbaram solution

 

Output:
Load
text([p-code]) as "Product code",
[con-group] as Customer,
'*ALL' as "Agreement code",
[consumer-desc] as Description,
[Unit_of_measure] as "Unit of measure",
[p-pack] as "Pack size",
[p-size] as "Pack size description",
[Variable_weight] as "Variable weight",
[Base_VAT_code] as "Base VAT code",
[com-desc] as Category,
ApplyMap('MAP-con-type',[con-type]) as "Contracted Price",
"act-date" as "From date",
PriceNew as Price

resident Temp;

concatenate

Load 'EOF' as "Product Code"

Resident Temp;

 

Let vOutputfilename=Replace('Catalogue $(vContract) '&today()&'.csv','/','-');

Store Output into '$(vOutputfilename)' (txt);

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

3 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi 

what is the content of the new line 

if the line should be part of the file you can use something like 

Output:
Load
text([p-code]) as "Product code",
[con-group] as Customer,
'*ALL' as "Agreement code",
[consumer-desc] as Description,
[Unit_of_measure] as "Unit of measure",
[p-pack] as "Pack size",
[p-size] as "Pack size description",
[Variable_weight] as "Variable weight",
[Base_VAT_code] as "Base VAT code",
[com-desc] as Category,
ApplyMap('MAP-con-type',[con-type]) as "Contracted Price",
"act-date" as "From date",
PriceNew as Price

 

resident Temp;

concatenate (Output

load 'A' as something 

autogenerate 1;

dmxmikey
Creator
Creator
Author

the new line I need to add on output is EOF as per below screensshot

Product codeCustomerAgreement codeDescriptionUnit of measurePack sizePack size descriptionVariable weightBase VAT codeCategoryContracted PriceFrom datePrice
23NOR*ALLxxxxPK2020x125gFALSEZeroBoxY09/10/20189.99
126NOR*ALLxxxxPK66x2.6kgFALSEZeroTinY17/10/201810.99
EOF            
PrashantSangle

Hi,

 

As @lironbaram suggested you can concatenate extra line at end of output data.

Enhancing @lironbaram solution

 

Output:
Load
text([p-code]) as "Product code",
[con-group] as Customer,
'*ALL' as "Agreement code",
[consumer-desc] as Description,
[Unit_of_measure] as "Unit of measure",
[p-pack] as "Pack size",
[p-size] as "Pack size description",
[Variable_weight] as "Variable weight",
[Base_VAT_code] as "Base VAT code",
[com-desc] as Category,
ApplyMap('MAP-con-type',[con-type]) as "Contracted Price",
"act-date" as "From date",
PriceNew as Price

resident Temp;

concatenate

Load 'EOF' as "Product Code"

Resident Temp;

 

Let vOutputfilename=Replace('Catalogue $(vContract) '&today()&'.csv','/','-');

Store Output into '$(vOutputfilename)' (txt);

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂