Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Renaming all field names

Hi,

As a part of my project, I developed a dashboard using Excel as a source(Excel to QVD, QVD to Dasboard). Now I want my source to be Apache HBase.

And also I don't want to change my datamodel. So, what I want to do is load all tables from Apache HBase to QVD files and use the same dashboard.

But the problem is the column names for Hbase are different from Excel.

For example:

Excel ColumnHbase Column
ACT_DSCdata:ACT_DSC
CD_TYP_DSCdata:CD_TYP_DSC

Similarly every column name is appended by the word 'data:'. I have nearly 1200 columns coming from 30 tables. Is there any automated way to rename all these column names.

I want a way to remove 'data:' from every column.

Regards,

Hemanth Dasari.

9 Replies
Chanty4u
MVP
MVP

KeepChar(FieldName,Act_DSC)  lik dat

Chanty4u
MVP
MVP

or

=purgechar(yourfield, ' .data:')

Mark_Little
Luminary
Luminary

Hi,

As other post,

Friendly Name using Rename.docx

Mark

Chanty4u
MVP
MVP

hi,

PFA

sample

Anonymous
Not applicable
Author

I dont think so it would be possible if Field from Excel and Hbase are different.

If field are different then you have to do seperate data modelling for same

jagan
Luminary Alumni
Luminary Alumni

HI,

You can rename all the columns in a single shot by using

FieldNameMap;

Mapping Load OldFieldName, NewFieldName From FieldNames ;

Rename Fields using FieldNameMap;

Example:

FieldNameMap

LOAD

*

INLINE [

NewFieldName, OldFieldName

PRD_TYP_DSC,data:PRD_TYP_DSC
CD_TYP_DATE,data:CD_TYP_DATE
TOT_AMT_DUE_IN_GC,data:TOT_AMT_DUE_IN_GC

];


Rename Fields using FieldNameMap;


Hope this helps you.


Regards,

jagan.

jonathandienst
Partner - Champion III
Partner - Champion III

You could use the Alias keyword before the load, "As', or Rename Using mapping after the load to rename the fields to remove the prefix

I suggest that you use Alias - you could create the list for the Alias in Excel and using Alias means that only the LOAD statements need to be changed from Excel to HBase. Your data model will be unaffected and your front end will need no changes.

Build a statement like this in Excel, and export to your script or to an include file (which may be easier to maintain).

     Alias

          [data:ACT_DSC] As ACT_DSC,

          [data:CD_TYP_DSC] As CD_TYP_DSC,

          ...

     ;

This should be executed before the HBase loads.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
tyagishaila
Specialist
Specialist

you can easily rename all fields in excel,

to rename, apply command on 1 field and apply on all fields and than paste renamed fields in your qv script.