Question about LDM Labels with multiple attributes...
# gooddata-cloud
s
Question about LDM Labels with multiple attributes like the example given here: • https://www.gooddata.com/docs/cloud/model-data/concepts/label/ If I want to display the Department Full Name as what is displayed, that would be the default. How does one indicate/make sure that the ID is what is used when joining the attribute instead of the default value?
From my testing it seems like the best advice would be to make the primary the ID, then add the attributes like Name, shortname, etc. to the ID. Then when someone includes the ID then uses the display as the Name or whatever attribute, you know that the SQL underneath is using the ID instead of the display name in the query.
Unless there is another way to specify the assumed query results...
(using /debug to download the queries and verifying by the way so I'm not guessing at this point.)
m
Hi Steve, the label that is set as the default attribute label in the UI is what is used in the query. Unfortunately I am not aware of any method to set a different label.
s
That makes no sense.
The default view is what you see in the filters
I’m seeing the opposite.
m
My mistake I misunderstood your question. Yes, you are right, adding the attributes to the ID would address this. May I know your use case or why is it important the ID is always used when joining the attribute instead of the default value?
s
Our display values can have duplicates.
So imagine I have two divisions as in the example. Both are named division 1 but have different ids
I don’t want them joined by display values I want to join on discrete entities
Unless I’m missing something with how that works.
t
Hello Steve, you should start by creating the attribute from a column with unique values (e.g., ID). Then add additional labels. Marking a label as a default one should influence only what is by default displayed in the UI, but should not influence query results. You can double check this by observing the IDs. Attribute ID should be the same as one of the labels, the one used for querying. I'm not aware that this "primary" can be changed once created.
s
I feel this should be added to the documentation and example for labels. The example is not explicit enough.
t
I agree. Let me send this feedback to the docs team 👍
👍 1
s
Either way thank you for confirming.