Hi team, have a few questions for GD: 1. This metr...
# gooddata-cloud
c
Hi team, have a few questions for GD: 1. This metric returns the correct result 12. But the it's reciprocal not right in GD, it works in the metric, but not when used in analysis. How can this be fixed? 2. In the map, even at maximum zoom, the venues are still overlapping, making them hard to distinguish. Is it possible to zoom in further? (The Tableau version is attached for reference.) 3. Is that possible to display labels for the line only, not for the bars? 4. Can GD charts or maps support diverging colors (e.g. red for negative, green for positive), similar to the example below?
k
Looking at your images, you have: • Metric 1 (works, returns 12):
SELECT FYear_max_half_LGA {metric/fyear_max_half_lga} - FYear_min_half_LGA {metric/fyear_min_half_lga}
Metric 2 (reciprocal, not working):
SELECT 1 / ( FYear_max_half_LGA {metric/fyear_max_half_lga} - FYear_min_half_LGA {metric/fyear_min_half_lga} )
The reciprocal
1 / (difference)
should theoretically work in GoodData MAQL using standard arithmetic operations. [Arithmetic Operations] However, based on a similar case in the community, a common cause of failures in division metrics is an issue with how the component metrics interact in the LDM context. Here are some steps to diagnose and fix the issue: 1. Simplify to isolate the problem Try replacing one side with a constant to see which part fails:
Copy code
SELECT 1 / 12
If this works, the issue is with the denominator expression, not the division itself. 2. Use a saved metric as the denominator Instead of inlining the subtraction in the denominator, save the difference as a separate named metric first (e.g.,
Half_LGA_Diff
), then reference it:
Copy code
SELECT 1 / {metric/half_lga_diff}
This avoids potential parsing or context-resolution issues with complex inline expressions in the denominator. [Arithmetic Operations] 3. Check for division by zero If the denominator evaluates to
0
in any context, GoodData will return
NULL
or an error for that row. Ensure the difference metric never returns 0. 4. Contact GoodData Support with the traceId If you see an error response, capture the traceId from the error payload and share it with GoodData Support along with your workspace ID and the metric definitions. They can look up the exact root cause in internal logs. [API errors] The most likely quick fix is saving the subtraction as a standalone metric and then dividing
1
by that saved metric reference. 👍 0 button 👎 0 button ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups. 👀 Our Support team monitors all messages and will jump in if needed.
c
Copy code
SELECT 1 / {metric/half_lga_diff}
This doesn't work either
j
Hi Cathy, Could you please provide a direct link to the dashboard or visualizations in question? We can take a look with the admin account and see what can be done here.
You can send the links in a DM if you prefer.
c
Thanks Joseph, this is the link: Metrics - GoodData Cloud, this is the metric
j
Hi Cathy, Thanks for this. I'm checking on the metric, and I believe it could work with something like the following:
Copy code
SELECT 1 / (
  SELECT
    CASE
      WHEN IFNULL({metric/fyear_max_half_lga} - {metric/fyear_min_half_lga}, 0) = 0
      THEN 1
      ELSE IFNULL({metric/fyear_max_half_lga} - {metric/fyear_min_half_lga}, 1)
    END
  BY ALL OTHER
)
As for the map and the labels, I'm afraid I will need to submit this as product feedback on your behalf. The Zoom functionality on maps doesn't go too deep, but we can certainly discuss this further with the product team. As for the labels, they will be displayed for both bars and lines, so it would also need to be submitted as product feedback to have options to use one or the other.
as for #4, you can certainly use conditional number formatting, but this won't display the country or city as a new color if that is what you are looking for
c
Thanks Joseph, I created the metric in GD, but it isn't appearing in analyse.
Hi Joseph, hope you're well. Can you help to have a look how to make this metric works in GD. The link is:Metrics - GoodData Cloud
s
Hi Cathy. I have impersonated our admin user at your project, and I can see this metric in Analyse. Can you please try clearing your browser's cache and cookies, or try it in another browser and check it again? I believe it should help. If you need any further assistance, just let us know.
m
Hi Cathy, I just wanted to followup here. I took a look at the metric you mentioned earlier: The link is: Metrics - GoodData Cloud When I open that link, it doesn’t direct me to a metric, but I found that same metric here in your workspace: CAGR_power_half_LGA After reviewing the metric, I can see that you have not completed the metric and you need to add the inner metrics there and tour labels:
Copy code
#       WHEN {metric/cagr_year_half_lga_year} = 0
#       THEN 1
#       ELSE {metric/cagr_year_half_lga_year}
#     END
#   BY {label/CURRENT_VGCCC_NAME}
You’re missing the metic: CAGR_year_half_LGA_year And the Attribute value: CURRENT_VGCCC_NAME} Please update the metric accordingly and add the missing metrics/attribute and let us know if you need any further help. If the metric it not working as expected, please provide more details, a report for test purposes and clarify what you’re seeing there, versus the results you would expect to see there.