Another question - Trying to build a report where ...
# gd-beginners
r
Another question - Trying to build a report where I can show a number of users who used a feature. Our data schema is primarily transactional (so each row in our data set is an interaction with our tool). There is a feature that we identify with a field 1/0. So I'd like to count(local user id where field = 1). Is this possible? How would I go about configuring this?
f
Hi Ryan, you can do that by creating a Custom MAQL Metric which would, in fact, look pretty close to your example:
SELECT COUNT (local user id) WHERE field = 1
Then you can add that metric to your desired visualization on the Analytical Designer and display it by the desired feature, for example, by adding the related attribute to the Rows section. Give it a shot and let us know how it goes!
m
Just to explain, in GoodData MAQL the COUNT function always returns number of distinct values of the attribute automatically. So it works as COUNT(DISTINCT ... ) would in SQL. So in your case no matter how many transactions a particular user made, they will be counted once and you get distinct number of users. And if you display the same metric also by month, for each month each user will be counted only once. But if that user used the feature in multiple months, they will be counted iin each such month once.
🙌 1
r
perfect - this is what I was looking for 🙂