Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have this table:
COMMERCIAL | Emploi | PRODUITS | REALISATION | score | SCORE_AVEC_PLAFOND |
---|---|---|---|---|---|
001 | CCPP | x1 | 331568 | 66314 | 1667 |
x2 | 84576 | 42288 | 1667 | ||
416144 | 66314 | 66314 | |||
002 | CCPP | x2 | 4752 | 950 | 950 |
x3 | 260579 | 130289 | 1667 | ||
265331 | 950 | 950 |
I have a problem with the sum here.
Can you explain why I got this mistake?
and anyone that can help me to resolve this issue please?
Thanks
Regards,
May be try this
score=
Sum(Aggr(
if(
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
<0,
0,
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
)
, COMMERCIAL, Emploi, PRODUITS))
SCORE_AVEC_PLAFOND=
Sum(Aggr(
if(match(REF,'19.1','377') and
Sum(Aggr(
if(
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
<0,
0,
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
)
, COMMERCIAL, Emploi, PRODUITS))
>2000*(5/6), 2000*(5/6),
Sum(Aggr(
if(
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
<0,
0,
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
)
, COMMERCIAL, Emploi, PRODUITS))
)
, COMMERCIAL, Emploi, PRODUITS))
What is the expression that you are using?
REALISATION= sum(VALEUR)
score=
if(
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
<0,
0,
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
)
SCORE_AVEC_PLAFOND=
if(match(REF,'19.1','377') and score>2000*(5/6), 2000*(5/6), score)
May be try this
score=
Sum(Aggr(
if(
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
<0,
0,
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
)
, COMMERCIAL, Emploi, PRODUITS))
SCORE_AVEC_PLAFOND=
Sum(Aggr(
if(match(REF,'19.1','377') and
Sum(Aggr(
if(
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
<0,
0,
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
)
, COMMERCIAL, Emploi, PRODUITS))
>2000*(5/6), 2000*(5/6),
Sum(Aggr(
if(
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
<0,
0,
if(IsNull(score_periode1), sum(score_periode2*VALEUR),sum(score_periode1*VALEUR))
)
, COMMERCIAL, Emploi, PRODUITS))
)
, COMMERCIAL, Emploi, PRODUITS))
excellent bro. thanks a lot
Can we write this way sunny?
score=
Sum(Alt(score_periode1, scoreperiode2)*VALEUR)
SCORE_AVEC_PLAFOND=
if(match(REF,'19.1','377') and Sum(Alt(score_periode1, scoreperiode2)*VALEUR) > 2000*(5/6), 2000*(5/6), Sum(Alt(score_periode1, scoreperiode2)*VALEUR))
I think there is a check for less than 0 also... may be like this
Sum(Aggr(RangeMax(Sum(Alt(score_periode1, scoreperiode2)*VALEUR), 0), COMMERCIAL, Emploi, PRODUITS))
Hey Amine,
can you also try this and let us know if this works too?
score=
Sum(Aggr(RangeMax(Sum(Alt(score_periode1, scoreperiode2)*VALEUR), 0), COMMERCIAL, Emploi, PRODUITS))
SCORE_AVEC_PLAFOND=
Sum(Aggr(
if(match(REF,'19.1','377') and
Sum(Aggr(RangeMax(Sum(Alt(score_periode1, scoreperiode2)*VALEUR), 0), COMMERCIAL, Emploi, PRODUITS)) > 2000*(5/6), 2000*(5/6),
Sum(Aggr(RangeMax(Sum(Alt(score_periode1, scoreperiode2)*VALEUR), 0), COMMERCIAL, Emploi, PRODUITS))
)
, COMMERCIAL, Emploi, PRODUITS))
Oh i missed that. Got it. Thank you.