I am having an issue with the count function- I ha...
# gd-beginners
n
I am having an issue with the count function- I have a customer events sql- defined however when i run my counts off of that table they do not match the counts I get when I run against the raw SQL. The counts are significantly lower- any ideas on what could be going on?
j
Hi Nate, Could you provide details as to how the metric is defined and if it is a primary key of the dataset? Depending on the COUNT syntax, it could affect what is being visualized.
n
here is the metric - it is not a primary key because we expect customers to have multiple events in this table.
j
Hi Nate, could you please send a link to the table you have created for this viz? We would like to access the workspace as an admin and run some tests from our end? Can you also confirm if any changes had been made to the LDM and if this count was previously matching the sql query? You can dm me a link to the table if you prefer.
m
Hi Nate, I am currently reviewing this matter and would like to clarify a few things to ensure we're on the same page: 1. Why are you using the attribute 'cust_id_string' in addition to 'customer_id'? I have compared the values, and they seem to be the same. 1. In the visualization you shared, I noticed several values and metrics, including comparisons with the 'Previous Period.' Is there an issue related to the previous period? If it isn’t, I recommend troubleshooting without considering the previous period for now and focusing on the count over a specific time range. I mention this because you didn’t address the 'Previous Period' in your comments. 1. From the screenshots you provided, I see some numbers, but it’s unclear which ones are incorrect and what the expected values are, can you please write down them? Once we clarify these points, we can continue our investigation. Thank you for your assistance with this matter.
n
Thanks: 1. this is an events table so i was looking for the count of customers have specific events at a given time. 2. The issue is more generally when a date is applied. E.g. when i select "last 12 months" the unique count returned in GoodData (14,015) does not align with what I get when I run against the source view (14499) 3. hopefully point 2 clarified this.
m
Hi Nate, thank you for this, last thing I forgot to mention, besides to use 'last 12 months' can we narrow it a bit to a fix date?, for example from 01/01/2025 to 31/08/2025. Additionally, could you share too the SQL query you are using to calculate the count on your source?