Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to count the customers for both 9-12/2019 and 1-4/2020
I did this and the intersection GIVES ZERO. This is incorrect.
Year and month are master calendar fields.
count( { < Year={'2019'},Month={'Sep,'Oct','Nov','Mar'}>* < Year={'2020'},Month={'Jan','Feb','Mar','Apr'}>} distinct CustomerID)
What am I doing wrong?
Try like:
count( {<CustomerID=P({ < Year={'2019'},Month={'Sep,'Oct','Nov','Mar'}>})>* <CustomerID=P({< Year={'2020'},Month={'Jan','Feb','Mar','Apr'}>})>} distinct CustomerID)
let's try with the below expression:
=sum( aggr( if( count( {< Year = {'2019'}, Month = {9,10,11,12} >} distinct orderNumber ) > 0
and
count( {< Year = {'2020'}, Month = {1,2,3,4} >} distinct orderNumber ) > 0,
1, 0 ), CustomerID ) )
Try like:
count( {<CustomerID=P({ < Year={'2019'},Month={'Sep,'Oct','Nov','Mar'}>})>* <CustomerID=P({< Year={'2020'},Month={'Jan','Feb','Mar','Apr'}>})>} distinct CustomerID)
Hi,
your code gives me error,
maybe i need this?
count ( {<customerId = P({< Year={'2020'},Month={'Ιαν','Φεβ','Μαρ','Απρ'}>} customerId ) >
*<customerId = P ({<Year={'2019'},Month={'Σεπ','Οκτ','Νοε','Δεκ'}>} customerId ) > }distinct customerId)
?
Hi @ioannagr
This works:
Count(distinct {<Year={'2019'}, Month={"Sep", "Oct", "Nov", "Mar"}> + <Year={'2020'}, Month={"Jan", "Feb", "Mar", "Apr"}>} CLIENT_ID)
Hope this helps,
That is optional. Please check the opening and closing combinations of various parenthesis...that is where the issue should be, if it is there..
Seems to be working now 🙂 Thanks 😄
My next question is, this is supposed to count CustomerIDs but when i link to sheet "IDs" , still all customerIDs show up, not only those this kpi counts.
Why is it that?
@ioannagr wrote:Seems to be working now 🙂 Thanks 😄
My next question is,...
Before coming to your next question..please mark/like the right solution. Also it's better to create a new thread for new question. If you feel this discussion reference is important for that - you could provide this thread as link there.
If you still want to continue here - could you please explain a bit more on your issue, if possible with a sample app?