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

Announcements
Register by January 31 for $300 off your Qlik Connect pass: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

getCurrentFieldname()??

Hi,

im am looking for a dynamic solution for renaming field in diagram. The idea was to have an excel file with the "technical names" und die "Humanreadable names" for each field.

In the renaming fields property of the diagram the field name is calculated by formular. For dynamic behaviour I need the fieldname that is appearing leaving the renaming field to blank.

How do I achive this?

Greedings Boris

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

1. If you want to mass rename the fields at the end of the script, MAPPING LOAD the excel file and then use

RENAME FIELDS USING mapname

I prefer this method because it allows the Current Selections box to match what the user sees.

2. If you want to leave the fieldnames as TechNames, but populate a chart label with the HumanName, you can load the excel sheet and use chart label expressions like:

=fieldvalue('HumanName',fieldindex('TechName', 'technameFieldName'))

Warning: In some QV Server versions, FieldIndex() does not work correctly. It always returns 0. I just tested in QV9 and it works. I'm ot sure at what release it was fixed.

3. A third option can be seen in some of the multiligual QV sample applications like "Films.qvw". This is a useful if you want the user to select language at runtime.

-Rob

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

1. If you want to mass rename the fields at the end of the script, MAPPING LOAD the excel file and then use

RENAME FIELDS USING mapname

I prefer this method because it allows the Current Selections box to match what the user sees.

2. If you want to leave the fieldnames as TechNames, but populate a chart label with the HumanName, you can load the excel sheet and use chart label expressions like:

=fieldvalue('HumanName',fieldindex('TechName', 'technameFieldName'))

Warning: In some QV Server versions, FieldIndex() does not work correctly. It always returns 0. I just tested in QV9 and it works. I'm ot sure at what release it was fixed.

3. A third option can be seen in some of the multiligual QV sample applications like "Films.qvw". This is a useful if you want the user to select language at runtime.

-Rob

Not applicable
Author

Hi Rob,

the second solution is exactly what we are trying to do. But ist there a way to fill the technameFieldName dynamicly?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP


Boris Erdmann-Jesnitzer wrote:But ist there a way to fill the technameFieldName dynamicly?


Not that I know of.

I've seen proposals to add a "LABEL FIELDNAME AS xxx" feature to the script. That would be useful. Check the Ideas section of the Customer Portal to see if that idea is proposed. You may want to vote for it or propose it if it doesn't exist.

-Rob

Not applicable
Author

Helpful Tip

First scenario is exactly the solution I needed