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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Export in Fixed Width format!

Can QlikView export a table contents in fixed Width text by one button and what macros should I have?
E.g. Let's say I have a table with the following data:

Name: Number:
Mary Johnson 1029384756

My source file should have a single space to divide and a Name of 30 symbols and a Number of 10 symobols.

Look at the attached file

Labels (1)
2 Replies
Not applicable
Author

Not sure if this is suitable, however my approach would be to pad out each column:

Load script:

Name & if(len(Name) <= 30, repeat( ' ', (30-len(Name)) ), 'String too long' & repeat( ' ', 15) ) as fw_Name

macro:

set foo = ActiveDocument.GetSheetObject("TB01")
foo.Export "C:\test.txt" , ""

depending on what you are doing with those fields elsewhere in the app, you may need to create a copy load and copy objects that are purely for the padded out values and use those for exporting, whilst preserving the originals for calculations etc.

Not applicable
Author

Thanks adamvaughan for your fast answer,

but I need VB macro to set formating, 'cause I want to modify some charts data..