Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
diegomen
Contributor
Contributor

Change Field name in QV chart with formula

Hallo,

in my projects I use a standard naming with prefix, for example T_YEAR, T_WEEK, etc. to distiguish misure, time fields, description fields, etc.

Now for some charts I must remove this prefix but I wouldn't rewrite the label for all fields so I'm finding a formula to make it.

Capture.PNG

It seems simple but I have a problem

Capture2.JPG

=MID('C_AZIENDA',INDEX('C_AZIENDA','_',1)+1,100)

I do not have to write "C_AZIENDA" but I have to indicate "THE FIELD" because the formula, which should remain the same in all the fields, should satisfy the reference of the name of that field.


Is it possible?


Thank you,

Diego.

6 Replies
vishsaggi
Champion III
Champion III

You mean the values in the field C_AZIENDA or the Actual field itself? May be use subfield function like

= SubField('C_AZIENDA', '_',2)

diegomen
Contributor
Contributor
Author

I mean the field label, not the content and I try to find a reference for this.


For example, [$ Fields] allows you to extract the list of fields but I need the reference of the field I am editing.


Thank you,

Diego.

vishsaggi
Champion III
Champion III

So it means individually in each dimension label you have to give the field name right? Or did misunderstood your requirement?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Unfortueatly, there is no way I know of indirectly reference the current Field, like "this" or "self".  The function GetObjectField() would get you close, but that function returns null when used in Label expression.

-Rob

diegomen
Contributor
Contributor
Author

Exactly, each dimension has a prefix and I must remove it to get only part of the label

vishsaggi
Champion III
Champion III

So you have to use Subfield function for each dimension label as a one time change. That is the only way.