Hi GD, still me :slightly_smiling_face: I am open...
# gooddata-cloud
r
Hi GD, still me 🙂 I am opening a separate thread from above as I have a separate question. We have a table in the LDM called Custom fields, this is connected to the User table and hosts attributes like Custom field name (e.g. Division) and Value (e.g. HR). The intention is to report on task completions for users, in a table report that should show various user attributes in the rows section (full name, location, any custom field name and values) and task attributes such as content name in the columns area. In order to show the custom field name and value as columns that resemble the other attributes, I am trying to bring Value into the rows area, and Custom field name in the Columns area. However this appears really oddly in the report (see attached) and gets worse in instances with multiple custom fields. Any advice on how to go about it?
đź‘€ 1
m
Hi Raffaella, would you please be so kind as to send us over the report so we can review this for you? Also, would you please be so kind as to provide more details on what the expected output of the report shold be (Perhaps a screenshot) versus the behaviour you’re seeing there currently? Once we fully understand the use-case we will be happy to review this further for you
r
Hi Michael, Thank you. Please find attached an image showing the ideal structure of the report: • Column A-C are user values, columns D and E would represent two separate custom fields with their corresponding value. • F-N would show tasks completed by the user for different content names and their overall compliance. I am struggling to reproduce a similar report and to show the custom fields as columns with their corresponding value, in the same row as the user details. Any suggestion highly appreciated 🙏
j
Hey Raffaella, thanks again for the details so far! I noticed Mike already asked this earlier, but just to make sure we can help you properly — would you mind sharing the direct URL to the report and letting us know which workspace this is in? That way we can check exactly how the fields are used in the report and confirm if it’s something that can be solved through modeling or needs a data transformation step.
âś… 1
Hi Raffaella, Thanks a lot for sharing both versions of the report and the workspace details — it really helped to clarify what’s happening. As suspected, the issue is due to how the
Custom fields
table is structured. Right now it uses an EAV (Entity–Attribute–Value) format, where each row stores a field name (like “Division”) and a value (like “HR”). That works fine on its own, but once you join it with task data, the report starts to duplicate rows per user-task combination — because each custom field generates another row. Unfortunately, this isn’t something we can fully solve just by tweaking the report or LDM. The data shape itself causes the row “explosion” — and GoodData doesn’t support dynamic pivoting of field names into columns in the UI out of the box. One possible workaround might be using an SQL dataset directly in GoodData Cloud to reshape the custom fields before using them in reports. Here’s some idea which should work:
Copy code
SELECT
  user_id,
  MAX(CASE WHEN custom_field_name = 'Division' THEN value END) AS Division,
  MAX(CASE WHEN custom_field_name = 'Grouping' THEN value END) AS Grouping,
  MAX(CASE WHEN custom_field_name = 'Staff Grouping' THEN value END) AS Staff_Grouping
FROM custom_fields
GROUP BY user_id
(it might some adjustment depending on your use-case and source data). In case you wouldn’t use SQL datasets or don’t want to modify the model, the only workaround would be to pre-flatten the custom fields during ingestion (i.e. outside GoodData), and load them as a proper user attribute table.
If you wish, please let me know and I will also gladly submit a product feedback on your behalf so we can consider some out of the box feature for dynamic pivoting.
r
Hi Julius, thanks for suggesting these workarounds. I would like to bring to your attention that the duplication of tasks is happening also outside of custom fields, e.g. using the Group name attribute (each user has 2 groups associated with them). So it feels like this would be an issue every time there are multiple values to a regular field, not only a custom field...
j
Yes that is correct, I was just following up on your example. I can confirm that this is a general behaviour in GoodData.
I’m sorry that this was not the answer you were hoping for, I will also submit a product feedback on your behalf.
p
🎉 New note created.
🙌 1
r
Thanks Julius for submitting the product feedback. Can I please ask a new question on this report. When aggregating Compliance % as average at "full name" user level, if all tasks had 0% compliance, the Avg field appear as blank. Is this a bug? expected behavior from my side would be that the field displays 0%.
j
Hello Raffaella, more than likely you will need to apply an IFNULL clause to the metric definition to enforce a numerical value. Can you please review this documentation and test the metric with this clause?
r
Hi Joseph, the Compliance % metric already has an ifnull clause and at individual task level this shows as 0%, but the Avg aggregation (which I've added by clicking on the header -> Avg -> Full name), is blank. This is not a metric but the out of the box functionality you can see when clicking on the header of a metric column in the table report. Compliance % is SELECT IFNULL( (SELECT COUNT({label/tasks.id}) WHERE {label/tasks.completed} = "true"), 0 ) / (SELECT COUNT({label/tasks.id}))
j
Hi Raffaella, could you please send a direct link to the table in question so we can check the behavior with the admin account? You can DM if you'd like.
đź‘€ 1
r
Thank you @Joseph Heun, I sent the link via DM
j
Hi Raffaella, thanks for this. I see what you mean with the missing 0 values in the totals. we are checking with product on the behavior here and will follow up with details as soon as possible.
Hi Raffaella, I'm going to submit this as product feedback on your behalf. Currently, it doesn't appear that the Null values will populate a total like this.
r
Hi Joseph, thanks for checking this for us. It seems odd for this not to be a bug. Hopefully the product feedback gets considered. Thanks again for your support.
p
🎉 New note created.