Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I would like to have the turnover of customers having 2 orders over a period.
But my formula does not work.
My order count is good
Nb of order : count( DISTINCT{<[Date Commande]={">=$(=vDateDébutAnnéeN) <=$(=vDateFinSeg)"}>} [N° Cde])
but not formula :
Turnerover for 2 orders= If( Aggr(count( DISTINCT{<[Date Commande]={">=$(=vDateDébutAnnéeN) <=$(=vDateFinSeg)"}>} [N° Cde]), [Code Client])=2
,[Ca Produit HT])
I need to aggr because in the end i need only one figure that will be the sum of all these clients
thanks for your help
May be this
Sum({<[Code Client] = {"=Count(DISTINCT {<[Date Commande]={"">=$(=vDateDébutAnnéeN) <=$(=vDateFinSeg)""}>} [N° Cde]) = 2"}>} [Ca Produit HT])
sum(aggr(count(distinct.....),[code client]))
Are you using this as your calculated dimension or is this an expression?
Turnerover for 2 orders = If( Aggr(count( DISTINCT{<[Date Commande]={">=$(=vDateDébutAnnéeN) <=$(=vDateFinSeg)"}>} [N° Cde]), [Code Client]) = 2, [Ca Produit HT])
If( sum(Aggr(count( DISTINCT{<[Date Commande]={">=$(=vDateDébutAnnéeN) <=$(=vDateFinSeg)"}>} [N° Cde]), [Code Client]))=2
,sum([Ca Produit HT]))
this is an expression
thanks
thanks but how to get afterwards only the sum of all this in a single expression?
then you need to "wrap" a sum around the Expression.
sum(If( sum(Aggr(count( DISTINCT{<[Date Commande]={">=$(=vDateDébutAnnéeN) <=$(=vDateFinSeg)"}>} [N° Cde]), [Code Client]))=2
,([Ca Produit HT])))
sorry it doesn't work
here it is a single expression which will give the result you want, did you try it ?
May be this
Sum({<[Code Client] = {"=Count(DISTINCT {<[Date Commande]={"">=$(=vDateDébutAnnéeN) <=$(=vDateFinSeg)""}>} [N° Cde]) = 2"}>} [Ca Produit HT])