Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Ho un certo numero di clienti che hanno comprato il prodotto A, alcuni il prodotto B, altri sia il prodotto A che il B....
come faccio a contarli?
Solo A:
COUNT({<MyTstTipo={A}, Cliente-=P({<MyTstTipo={B}>} Cliente)>} DISTINCT Cliente)
Solo B:
COUNT({<MyTstTipo={B}, Cliente-=P({<MyTstTipo={A}>} Cliente)>} DISTINCT Cliente)
Giusto?
Ma per quelli che hanno comprato tutt'e due come si fa?
Marco,
I manage to understand italian (latin language, like portuguese), but I do not speak/write italian, so my answer will be in english. I hope that's not a problem.
You may try:
COUNT({<MyTstTipo={A,B}, Cliente-=P({<MyTstTipo={A,B}>} Cliente)>} DISTINCT Cliente)
Best regards
The set analysis I suggested before will return "A or B".
In order to get "A and B", it may be better to try:
COUNT({<MyTstTipo={B}, Cliente-=P({<MyTstTipo={A}>} Cliente)>*<MyTstTipo={A}, Cliente-=P({<MyTstTipo={B}>} Cliente)>} DISTINCT Cliente)
No: in your example I will get 0, because I ask for Clients both with only "A" AND with only "B".... impossibile.
I have some clients that purchased product "A" and some other product "B", some other purchased "A" and "B", how can I count them?
Only A:
COUNT({<MyTstTipo={A}, Cliente -=P({<MyTstTipo={B}>} Cliente)>} DISTINCT Cliente)
Only B:
COUNT({<MyTstTipo={B}, Cliente -=P({<MyTstTipo={A}>} Cliente)>} DISTINCT Cliente)
Is it right?
But how can I count who purchased both products?
EUREKA!
Here the answer:
COUNT({<MyTstTipo={A}, Cliente =P({<MyTstTipo={B}>} Cliente)>} DISTINCT Cliente)
I.E.
Count every Client with MyTstTipo="A" that is in group of all clients with MyTstTipo="B"