Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the following table:
OrderId StartDate EndDate
1 2010-1-1 2010-2-1
1 2010-2-3 2010-3-1
2 2010-1-1 2010-5-1
The orderId is allowed duplicate because the valid date range is different.
Now I want to get the following forms and use pivot to show.
OrderId Min StartDate Month Count
1 2010-1 2
2 2010-1 1
How to achieve it?
Straight table like this:
orderid date(min(startdate),'YYYY-MM') count(enddate)
Thanks for your reply.
If I don't want to show the OrderId,
The results like this
Min StartDate Month Count
2010-1 3
If the min month is the same, I want to merge them into one month, and also show the total count in the count column.
Is it possible?
Thanks.
I don't know if I good understand... but perhaps that...
Sample table: dimension date(min(datestart),'YYYY-MM')
expression count(enddate)...