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

Markup qvd

Hello,

Is there a markup or a field in the file qvd that can indicate from which qvw this qvd is created?

Thanks

Kai

4 Replies
Miguel_Angel_Baeyens

Hello Kai,

You can create that using functions DocumentPath() and DocumentName() which will return the path where the QVW file is stored and the name of the QVW file. Adding this to the tables you store you can identify which QVW created which QVD files.

Table:LOAD *, DocumentName() AS SourceFROM File.qvd (qvd); STORE Table INTO File.qvd;


Hope this helps

Not applicable
Author

Hello Miguel,

Yes, that is exactly what I did. However, in my system, a qvd may be used by another qvw to create another qvd. Then an error 'Field names must be unique within table' is generated since the table contains already the field 'Source'.

Best wishes,

Kai

Miguel_Angel_Baeyens

Hello Kai,

Then you have to analyze which of the QVW you want to have. If they are a fixed number (say 3) you can create Source1, Source2 and Source3 fields, one for each of the QVW files, so at least one of them will always be populated.

Another option is using a preceding load (the Plain files button in the script editor window) will help so instead of using LOAD * you will have all fields loaded, and you will change the actual Source by the new field you create.

Say the file File1.qvd has the following fields: ID, Amount, Source. Your load script will look like

File1:LOAD ID, Amount, SourceFROM File1.qvd (qvd);


Then, modify it to look like

File1:LOAD ID, Amount, DocumentName() AS SourceFROM File1.qvd (qvd);


Hope that helps

Not applicable
Author

Hello Miguel,

This may be the only solution...

Thank you

Best wishes