Hello Team, I'm trying to build a metric which sho...
# gooddata-platform
h
Hello Team, I'm trying to build a metric which shows the active users during 1 month and during 3 months. For this I count the users within the span of 1 month (aligned with our posting date). I tried to pour that logic into a Metric so that I can use it in relation with the THIS logic on any date. AU1M (Active user during 1 month), defined as such SELECT COUNT(Userprofile Id) WHERE Month/Year (Posting Date) = THIS And AU3M as such: SELECT COUNT(Userprofile Id) WHERE Month/Year (Posting Date) BETWEEN THIS - 2 AND THIS But it doesn't seem to work. Can you help?
j
Hi Hans, depending on your LDM you may want to use a two-parameter version of the count function. Also, a BY clause might need to be used to connect the date dimension, but this depends on the LDM set up. Lastly, if values are not appearing as they should, you may want to check the validation of the workspace as well.
m
Hi Hans, can it be that such values are not in the data? if the very first metric in your screenshot is unrestricted count of userprofileIDs and it is only giving you data for Jan and Feb 2024, it would make sense that AU1M and AU3M do not return anything as they are filtered to THIS (May 2024) and THIS-2 to THIS (Mar 2024 to May 2024) dates. The THIS macro relates to current actual system date no matter what dates are in the data.
h
Hi Joseph, the User Profile ID and Posting Date are in two related tables Expense and Transaction which related (M:1). The Validate project so far goes fine for these tables and values. I will now process the answer of Michal. 🙂