Hey everyone, struggling with MAQL a bit, seems li...
# gd-beginners
Hey everyone, struggling with MAQL a bit, seems like everything i’m trying doesn’t quite work the way i thought it would, trying to write the MAQL equivalent of the following SQL as a metric
Copy code
select count(*)
from (
      select email, SUM(hours) as total
      from user_hours
      where date between '2022-05-01' and '2022-07-01'
      group by email
) as t
where t.total > 10
I tried to do
Copy code
SELECT ... BY ... WHERE SUM(...) > 10
but it seems the
aggregates all values in the dataset, not across the slices, i also tried a
but i need the count of records
Hi Hunger, I am not sure I understand the goal of the metric you want to build, but have you tried simplyfing it, and then applying filters to the insight directly instead? E.g.: Filters in the GoodData Platform - Gooddata Free
hey moises, i figured out a way of getting it to work, i simplified it quite a bit and did what you said + called one metric from another to mimic a sub-query
thanks 😄
Glad to hear! 🙂
whiel i got ya, i tried to use
ISNULL(metric, 0)
with no luck, is there anyway to return 0, when there’s no data?
We also have a free MAQL course in our University in case you are interested: https://university.gooddata.com/getting-started-with-maql
oooh that class is next on my list once i get this out the door… 😄
👍 1
This Community post can help with your new question: https://community.gooddata.com/metrics-and-maql-57/null-column-529
excellent thanks 😄
🙌 1