Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Margaret
Creator II
Creator II

GetObjectField() works in Expression Label but not in Dimension Label

I have Qualified my tables: the fieldnames look like 'TableName.FieldName', so they don't join with other tables with fields with the same name.

But I want to take out the TableName when I display the field and it's value in a chart. And I don't want to re-type a label for every single field name. I am using the fields as Dimensions. But I'm having trouble removing the 'TableName.' in the Label. The first step that doesn't work is GetObjectField(). I put this as the Label for the Dimension and it doesn't work. I put the exact same thing in the Label field for an Expression with the exact same field in it, and it works.


Is there something else I should be using for a dimension label?


Thx!!

1 Solution

Accepted Solutions
marcus_sommer

In this example: getobjectfield(0, 'CH01') the 0 is the first parameter referencing to the column-number within the chart and the second parameter 'CH01' is referencing to the object-id.

In your case it will return what is used within the called column and if the field is qualified it will return this name. This meant you would need to transform it further and more important each of these expression must be written with its unique parameter. This would be not easier as to write each label manually rather the opposite.

- Marcus

View solution in original post

4 Replies
marcus_sommer

To get a result from getobjectfield(0, 'CH01') within a dimension you need to use both parameter like here. But it won't be very helpful in your case and I think you will need to re-type everything manually.

Better would be to avoid qualifying completely and to name all your fields explicitly or if you really really need this kind of information within your developing-workflow to rename the fields after loading all data - quasi within the last step before the load is finished. See for it here: How to Rename Fields especially the mapping-version.

- Marcus

Margaret
Creator II
Creator II
Author

What would the second parameter be? I only see documentation about a GetObjectField() function with one parameter: GetObjectField - chart function ‒ QlikView

And even if I added a parameter, what about my situation makes it not work?

marcus_sommer

In this example: getobjectfield(0, 'CH01') the 0 is the first parameter referencing to the column-number within the chart and the second parameter 'CH01' is referencing to the object-id.

In your case it will return what is used within the called column and if the field is qualified it will return this name. This meant you would need to transform it further and more important each of these expression must be written with its unique parameter. This would be not easier as to write each label manually rather the opposite.

- Marcus

Margaret
Creator II
Creator II
Author

Got it! I knew I'd still have to manipulate it after GetObjectField().

I used SubField to get the text after the '.' out:

=SubField(GetObjectField(0,'CH26'),'.',2)

Thank you!!