Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I wolud like to know the count of unique orders when below conditions get satisfied:
DateKey>=SelectDateFrom and DateKey<=SelectDateTO
My expression is:
COUNT(IF(DateKey>=SelectDateFrom and DateKey<=SelectDateTo,(DISTINCT([Order Count]))))
i do not know, where I am doing wrong.
any idea?
Thanks in advance.
Hi,
Try this expression
=COUNT({<DateKey={'>=$(=SelectDateFrom)<=$(=SelectDateTo)'>} DISTINCT [Order Count])
Or you can also try like this. In you Order table arrive a new column (OrderCount) with value 1 for every record and use the following expression
=Sum({<DateKey={'>=$(=SelectDateFrom)<=$(=SelectDateTo)'>} OrderCount)
Because Distinct may cause performance issues.
Hope this helps you.
Regards,
Jagan.
Hi,
Try this expression
=COUNT({<DateKey={'>=$(=SelectDateFrom)<=$(=SelectDateTo)'>} DISTINCT [Order Count])
Or you can also try like this. In you Order table arrive a new column (OrderCount) with value 1 for every record and use the following expression
=Sum({<DateKey={'>=$(=SelectDateFrom)<=$(=SelectDateTo)'>} OrderCount)
Because Distinct may cause performance issues.
Hope this helps you.
Regards,
Jagan.
Hi Jagan,
thanks for ur quick reply.
i have to use ur first solution as order count is a test column.
below expression is showing red line when pasted it in Edit Expression.u know what is wrong?
=COUNT({<DateKey={'>=$(=SelectDateFrom)<=$(=SelectDateTo)'>} DISTINCT [Order Count])
Hi jagan,
=COUNT({<DateKey={'>=$(=SelectDateFrom)<=$(=SelectDateTo)'>} DISTINCT [Order Count])
Can i know why you are keeping = sign in blue colored area in your expression ? Actually i'm not much aware of this concept.
Thanks in advance.
Hi,
Is SelectDateFrom and SelectDateTo are variables? If they are not variables then post some sample data, so that it would be easier to understand.
Regards,
Jagan.
You missed curly brace before distinct
COUNT({<DateKey={'>=$(=SelectDateFrom)<=$(=SelectDateTo)'}> }DISTINCT [Order Count])
Sivaraj change did the trick.
Thank you Jagan & Sivaraj.
Hi,
Please close this discussion if your problem solves.
Venkat :
For Date fields we need to put =.
Regards,
jagan.