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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
UrsulaWhite
Contributor II
Contributor II

Remove Prefix from all fields

I am loading a qlik qvd and all the fields have a prefix.  

Example:

Load
       Sales.SalesID,
       Sales.SalesPerson,
       Sales.Item,
       Sales.Cost
FROM [lib://Example/Sales.qvd] (qvd);

I thought that I could perhaps name the table Sales and then use Unqualify *; but it didn't work.
Any other possible solutions?

Labels (1)
4 Replies
Mark_Little
Luminary
Luminary

Hi

Sadly i can't thing of easy answer, you would be able to probably write a loop with variables to do it, but probably more work that it is worth.

If i was working on this would be questioning why it is getting qualified in the first place and maybe address this is the app outputting the QVD?

MayilVahanan

Might be, try with rename fields with Mapping table

Rename field ‒ QlikView

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
ogster1974
Partner - Master II
Partner - Master II

A dirty hack but quick.

Copy your load script into Excel

=CONCAT(SUBSTITUTE(I14,",",""), " AS ", TRIM(SUBSTITUTE(SUBSTITUTE(I14,",",""), "Sales.","")))

ogster1974_0-1672913017538.png

 

akersdl
Contributor
Contributor

If  you are still looking for an automated solution, here is a subroutine to process this type of issue. 

 

sub Removefieldnameprefix (delimiter,table)

Let vdelimiter = '$(delimiter)';
Let vtable = '$(table)';
Let vNoFields = NoOfFields('$(vtable)');

for a = 1 to $(vNoFields)
Let vFieldname = FieldName($(a),'$(vtable)');
Let vIndex = len(subfield('$(vFieldname)','$(vdelimiter)',1))+1;
Let vlen = len('$(vFieldname)')-$(vIndex);


FieldMap:
Mapping
Load
'$(vFieldname)' as oldname,
right('$(vFieldname)',$(vlen)) as newname
AutoGenerate 1;

next a;

Rename Fields using FieldMap;

end sub;

Call Removefieldnameprefix (your_delimiter,yourtablename)
// for example
//call Removefieldnameprefix ('_','parkmobile_daily_transaction');

 

Hope it helps.