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!!
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
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
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?
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
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!!