According to the documentation https://developers.amplitude.com/docs/identify-api, I should be able to make date comparisons if in the format ‘YYYY-MM-DD’. I have enriched a few test users with an identify API call that adds some fields in that format, yet I cannot seem to figure out how to make those fields usable in any sort of analysis. (Ex: select all users who performed any event where this date field is greater than or equal to a date that I input). It just shows nothing.
Am I doing something wrong within Amplitude or is the data I’m sending possibly in the wrong format?
Best answer by belinda.chiu
So it should be the case that you can make date comparisons so long as the format is the ISO 8601 format (YYYY-MM-DDTHHss), which will allow you to perform date comparisons in the platform, (e.g. '2016-01-31' > '2016-01-01'). This will also work for datetime values (e.g. '2017-08-07T10:09:08' > '2017-08-07T01:07:00'). Amplitude compares dates as strings. https://developers.amplitude.com/docs/http-api-v2#setting-date-values
When creating a chart in Amplitude, you should be able to do something like this: https://analytics.amplitude.com/demo/chart/new/2d2k9ac
If you are setting up the chart similarly as I have but the chart is not returning anything, then it is likely that you either are sending the data in the wrong format or perhaps there is no data that is greater than or equal to the date that you input.
Hope this helps - let me know if you have any questions!