Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vongalaprashant
Contributor III
Contributor III

How to change one delimiter to other?

Hi All,

qualify *;

RP:

LOAD

  Field1,

  Field2,

  Field3,

  FROM [lib://20153098/Book11111.xlsx]

(ooxml, embedded labels,table is Sheet1);

Unqualify *;

So, by loading this I will get my output as -------- RP.Field1,RP.Field2,RP.Field3 .



The output is with tablename.Fieldname.  The  default delimiter is .(dot) between them.


My requirment is I want to qualify all the fields but the delimiter I want is '_' (underscore).


So,Is it possible to convert one delimiter to other and qualify fields ?


Many Thanks,

Reddy.

6 Replies
Siva_Sankar
Master II
Master II

We can use a little script to whip through the data model and rename all of our fields to something friendlier for example tablename_fieldname

The only caveat is that it won’t rename a field to an existing field name (linked fields) so this still needs to be done manually, but if everything is qualified then you don’t have any links in the first place!

For vTable = 0 to NoOfTables() -1

   Let vTableName = TableName(vTable);

For f = 1 to NoOfFields('$(vTableName)')

    let vFieldOld = FieldName($(f),'$(vTableName)');

    let vFieldNew = Replace('$(vFieldOld)','$(vTableName)'&'.','_');

    RENAME FIELD $(vFieldOld) to $(vFieldNew);

Next f; 

Next ;

-Siva

shiveshsingh
Master
Master

U need this?

RP_Field1,RP_Field2,RP_Field3 .

vongalaprashant
Contributor III
Contributor III
Author

Hi Shivesh,

ya ,that is what I need excatly.

regards,

reddy.

tripatirao
Creator II
Creator II

if fields are less then rather than using qualify statement use filed aliasing.

ex field1 as RP_field1.

sasiparupudi1
Master III
Master III

Siva_Sankar
Master II
Master II

Hi Prashanthi,

Did you try the scrip i posted? Or share sample data, i will help.

-Siva