How can I modify my Redshift query to find a unique user that includes the merged Amplitude ID in addition to the WHERE condition?
The results of the query from the Amplitude segmentation and the unique user I found in Redshift are different, even though the WHERE condition and duration are the same. The number of the unique users from Redshift more then amplitude’s result.
I suspect that the difference may be due to the merged Amplitude ID, device ID and user ID.
Here’s how the merged user id table will look like in your exported data along with the event table schema
To take into account merged ids, try using a JOIN condition for joining the event data table with the merged user table - the amplitude_id being the join key. Then a distinct count on the user_id should help remove the duplicates introduced as a result of the JOINed dataset.
Let me know if this works out.
Thank you for your response!
Your solution has been helpful in removing duplicate amplitude_ids. However, there still remains a discrepancy between the unique users identified by the Amplitude segmentation board and the results from my Redshift query.
Here is my refined query that eliminates duplicate users. It has been successful in identifying and removing approximately 80% of the duplicated users.
select a.user_id, a.amplitude_id from events_1234 a left join merge_ids_1234 b on a.amplitude_id = b.amplitude_id WHERE DATE(event_time) between '2023-01-01' and '2023-01-07' AND platform IN ('iOS', 'Android') and user_id is not null group by a.user_id, a.amplitude_id
Maybe I missed unmerged amplitude_ids. How can I find that?
I've analyzed the unique user data from Amplitude by following the steps below:
Obtained user information from the Segmentation dashboard by clicking the 'Download Users' button.
Exported the query results from Redshift.
Compared the Amplitude IDs from both datasets to identify any discrepancies or overlaps.
These steps helped me to effectively evaluate the unique users in Amplitude and cross-reference them with the query results from Redshift.
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. You can also create a Guest account below!
If you're a current customer, select the domain you use to sign in with Amplitude.
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. Want to sign up as a guest? Create a Community account.
If you're a current customer, select the domain you use to sign in with Amplitude.