Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
I can not cope with writing a set analysis that will show me the last two shopping dates (for each customer).
Data scheme as in the attachment.
I would like to get very simple table:
CustID | Last date (from sales) | Last but one date (from sales) |
---|---|---|
C100 | 01-08-2018 | 31-07-2018 |
C105 | ... | ... |
... | ... | ... |
If I do it in this way:
max({<[Date={"<$(=max([Date]))"}>} [Date])
It only works for the client I choose with the filter. How to make the dates correct in the entire table - without selecting clients?
Try this:
For last date: Date(Max(Date))
For last but one date: Date(Max(Date,2))
Try This
DateField={"<=$(=max(date(addmonths(DateField, 0))))>=$(=max(date(addmonths(DateField, 0)-2)))"}
It does not work for me. I do not know if I have explained the case well. Each customer will have different dates of the last purchase and the last but one.
maybe with the below expression for last shipping date:
firstsortedvalue( Date, -Date )
and for previous last shipping:
firstsortedvalue( Date, -Date, 2)
Try this:
For last date: Date(Max(Date))
For last but one date: Date(Max(Date,2))
Thanks Tim!
It looks like it was simpler than I could have imagined!
You're welcome!
I had the exact same issue and indeed, the solution was simpler than I had thought at the time.
Glad I could help.
Kind regards,
Tim P.