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

Export all qvw's field names qualified without using Qualify in the script...

Hi experts,

I want to export the qualified field names (Table.Field) of one given application, but its script doesn't have the Qualify * command in it, hence the export option gives me only one file with all the Fields and other with all the Tables.

Is there a parameter to do that within the Document ? Any workaround suggested ?

Thank you in advance by the attention,

Best regards,

Marcos

Qlikview version: 11.20.12904.0 SR12

5 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Marcos,

THe following code gets the field name and tables associated with it.

Just add a table with the both generated fields of the new table and export it. THe names are "qualified" by table name.

X:

load * Inline

[

Prestador,Internações, Partos

AAA, 4,1

BBB, 5, 4

CCC, 5, 3

DDD, 6, 2

];

Y:

Load * Inline

[

FieldA,FieldB

1,2

3,4

];

for i = 0 to NoOfTables()-1

let vTest = TableName(i);

for j = 1 to NoOfFields('$(vTest)')

tableNameFields:

Load

'$(vTest)' as [Table Name],

'$(vTest).' & FieldName($(j),'$(vTest)') as [Field Name]

AutoGenerate(1);

next j;

next i;

Result:

sample.png

Felipe.

Marcos_Ferreira_dos_Santos
Author

Hi Felip,

Thank you for your contribution, it helped me a lot.

In fact, a friend of mine today did come up with a simpler solution: generate an object Table wih the fields $Table and $Field, in the Document to reverse engineer, then export to a txt/csv file.

felipedl
Partner - Specialist III
Partner - Specialist III

That might be the case, but unless you qualify the table, you'll have to make the transformation outside.

It's another way to do it too.

Felipe.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Open the document from which you want to export all fields in a "qualified" format in QV Desktop.

Add a listbox using New Sheet Object->List Box..., but instead of selecting a field to display, you navigate to the bottom of the field list and select <Expression>. An expression editor window will pop-up. Enter something like the following expression (vary the layout according to your requirements):

='[' & $Table & '.' & $Field & ']'

Close the properties dialog. A listbox with qualified field names will be shown on your sheet. From the Listbox right-mouse-button-menu, select Send to Excel...

Tada !

Marcos_Ferreira_dos_Santos
Author

Fantastic Peter,

Thank you very much for this contribution. Very useful tip!