Zuzana Vranova
06/19/2024, 11:28 AMPAYMENTS
(which has all payments) and THREEDS
(which has only payments where 3ds was requested) joined on PAYMENT_ID
. I created the rate metric in GoodData SELECT COUNT({label/THREEDS.PAYMENT_ID}) / COUNT({label/PAYMENTS.PAYMENT_ID})
however it always returns 100%, I assume because GoodData does inner join when building the query so not all records in PAYMENTS
table are counted. Can you advice how to modify the metric so that I would get the actual rate?Francisco Antunes
06/19/2024, 12:29 PMPayment ID
on Payments
, the unique count of IDs will still be the same as in Threeds
, which results in a total of 1.
I am not sure how your Data Model is constructed, but I would recommend using a different attribute for one of the counts - preferably, so that you are counting the primary key of both datasets.
If there is still some ambiguity in the context of the COUNT, you may need to specify it via the USING keyword. I’d recommend taking a look at the Count Function article for some more info.Michal Hauzírek
06/20/2024, 2:10 PMZuzana Vranova
07/05/2024, 10:17 AMSELECT COUNT({label/THREEDS.ACTION_ID}) / COUNT({label/PAYMENTS.PAYMENT_ID})
Michal Hauzírek
07/06/2024, 3:16 PMSELECT
COUNT({label/payment_id},{dataset/threeds})
/
COUNT({label/payment_id},{dataset/payments})
(note that the exact identifiers might be different in your case. But the main difference from what you posted is that:
• the first parameter in both COUNTs is the same - the paymentID (from payments)
• the second parameter in both COUNTs is different:
◦ once it is dataset payments
◦ once it is dataset threeds
The second parameter defines where (in which table) should it count the PaymentIDs.Zuzana Vranova
07/08/2024, 11:51 AMCREATED DATE
or any attributes from PAYMENTS
😞 I think I will just add a 3ds flag to our Payments table which should solve this issue.
Ideally I would like to be able to create this kind of flag in GoodData, something like SELECT IF THREEDS.PAYMENT_ID IS NOT NULL THEN TRUE ELSE FALSE
and use this as an attribute in my metrics / visualizations. As this functionality is not supported at the moment, are there any plans to add it? Seems pretty standard in other tools, e.g. Tableau.Michal Hauzírek
07/08/2024, 8:57 PMMichal Hauzírek
07/08/2024, 8:59 PM