The fields in the purchase log table are as follows:
uid, date, category, and amount are all unique identifiers.
I'd also want to know the dates of each user's first and second purchases in each category.
Consider the following scenario:
+-----+------+----------+--------+
| uid | date | category | amount |
+-----+------+----------+--------+
| A | d1 | c1 | 100 |
| A | d2 | c2 | 200 |
| A | d3 | c1 | 150 |
| A | d4 | c2 | 400 |
+-----+------+----------+--------+
For the following user data, I'd want to state that the first purchase from category c1 occurred on day d1, and the second transaction occurred on date d3.
I've developed three computed fields so far:
-
1st purchase:
{ FIXED [uid] : MIN([date])}
-
Repeat purchase:
IIF([date]>[1st Purchase],[date],null)
-
2nd purchase:
{ FIXED [uid] : MIN([Repeat Purchase])}
However, because there is no differentiation between categories, I am unable to view dates in relation to them.
How do I approach this issue?
Thanks.