Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count Distinct or aggr

Hi all,

I have an easy question (but after many test actually i'm confused...)

I would like to know on each dimension (Market Area)

- how many order i have count(distinct OrderId) It works

-----------------------------------------------------------------------------------------------------------------------------------------------------

how many order have a price >100€ Wrong Result

=sum(aggr(if(Price >100, 1,0 ) , OrderId) ) or

if(Price>100, count (distinct OrderId))

_____________________________________________________________

how many lines have a price > 100€.

sum(if(O$PREZ>10), 1,0)

Wrong !

Wrong !

Wrong !



Many Many Thanks

Claudio

4 Replies
spsrk_84
Creator III
Creator III

Hi,

Try in this way

Count( if(Price>100, distinct OrderId))

Not applicable
Author

hi,

probably u can use this

Count(distinct If(aggr(Sum(Price),OrderId)>100,OrderId))

i haven't tested it but u can give it a try

thanks

Not applicable
Author

hi

try this

count(distinct(if(Price>100,orderid)))

regards

Peter

Not applicable
Author

Many thank

they work perfectly (The first one was wrong)

Claudio