11 Replies Latest reply: Mar 15, 2017 9:57 AM by Zied Ahmed

# how to count only one row in this is example

Hello ,

this is my problem

i have fields

car

date

parc

country

i need if in one date for one car to count juste one row not 2 event if have 1 in the parc FR and 1 in the parc IT

(IT=1 and FR = 1 the result one row (total 1) and this is the picture of the example

• ###### Re: how to count only one row in this is example

What is your expression right now?

• ###### Re: how to count only one row in this is example

i have a simple expression count(Dossier) i need when i have (IT= 1 and FR = 0 result must be 1) or when i have

(IT=0 and FR = 1 result of count is 1 ) and for the (IT=1 and FR = 1 result must be 1 not 2 ) this must applicate to the country MAR

• ###### Re: how to count only one row in this is example

May be like this

Max(Aggr(Count(Dossier), car, date, country))

• ###### Re: how to count only one row in this is example

don't work maybe we forget the parc

just one another thing when i have IT=0 and FR = 0 the count of dossier wil be 0

• ###### Re: how to count only one row in this is example

this is for country=MAR not other countries too

• ###### Re: how to count only one row in this is example

Yes... may be this

Max(Aggr(Count(Dossier), car, date, parc, country))

• ###### Re: how to count only one row in this is example

it works thanks..just i need it in this other expression please :

Count({<\$(vSetPeriodPres),country={'MAR'},Groupe_Complet_Vide={'3,5,2'}>}Dossier)

• ###### Re: how to count only one row in this is example

May be like this

Max({<\$(vSetPeriodPres),country={'MAR'},Groupe_Complet_Vide={'3,5,2'}>}Aggr(Count({<\$(vSetPeriodPres),country={'MAR'},Groupe_Complet_Vide={'3,5,2'}>}Dossier), car, date, parc, country))

• ###### Re: how to count only one row in this is example

it gives the number 1...i have for example 400 dossiers i need just to eleminate 'dossiers' who have 2 dossiers for one car in one date for country morocco

• ###### Re: how to count only one row in this is example

Would you be able to share your app and point out what is wrong. Just by looking at the expression, it is very difficult for me to understand your requirement

• ###### Re: how to count only one row in this is example

Sunny,

I have for example 400 rows for country Morocco but there is some cars have for 1 date "1" in two parcs and this is wrong,so to correct the problem when i have 1 in parc FR and 1 in par IT we need to considerate that we have just one row not two so the total number fo Dossier will be 399