Hello all :wave: We're in need of an absolute-val...
# gooddata-cn
Hello all đź‘‹ We're in need of an absolute-value calculated field/column in a dashboard (which I think means we want a "calculated measure" -- apologies if my GoodData terminology is a bit off). We have rows in a table with percentage changes, but we need to sort this by the absolute value of the percentage change in order to put the biggest deltas (whether positive or negative) at the top. Is there any way to accomplish this? We see the ability to specify Sum, Difference, Change, etc. (as outlined here: https://www.gooddata.com/developers/cloud-native/doc/1.5/analytics/ad/measures/calculated-measures-in-insights/), but no ability to specify an Absolute Value. Is there any way to specify our own calculated measures beyond the five provided, perhaps with some back-end SQL or similar?
Hi Philip, these “calculated measures” are offering just some basic ratios between two measures that you already have in your insight, but you can unlock the full potential of GoodData by defining your metrics in the MAQL language using the metric editor. This language offers you a lot of functions including ABS for absolute value. In MAQL you can not reference the “calculated measures” defined visually, but you should be able to create any metric from them in MAQL as well (or we can help you here). If you already have the % difference in your data, this metric in MAQL would be something like
SELECT ABS( perc_change_value )
or if the perc_change_value is not a metric already but just a column (fact) in your table, you would need to add some aggregation to it as well, for example:
SELECT ABS( MAX(perc_change_value) )
BTW the quickest way how to get to a metric editor is to click the “Create metric” in the bottom left corner of the Analytical Designer.
Thanks you @Michal HauzĂ­rek! We'll look into this.