Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
shasha3006
Contributor
Contributor

count distinct with multiple criteria

hi good people,

want to asking, 

i have count distinct with multiple criteria

but, the result just count distinct without criteria

ex.

vehicle     status

bicycle      new

bicycle       old

car              new

car             new

 

I want to count distinct person have vehicles ,like :

car new =2

my script is :

Count(distinct{< vehicle={"car"},status={"NEW"}>} person)

but the result just : 4

😞

I appreciate any help

 

shasha

Labels (5)
6 Replies
pedrobergo
Employee
Employee

Hi @shasha3006 

How is it your model?

The table containing person is associated with table containing vehicle and status ?

If you have blank / null values for this filtering for all persons, it will bed counted also.

[],

Pedro

deepanshuSh
Creator III
Creator III

If the tables containing all the fields are linked then this should work 

Count({< vehicle={'car'},status={'new'}>} distinct person)

Also, 

you can check by putting the values in a table and clicking on the filter values corresponding to the vehicle and status and then check if the values are coming out to be same or not.

 

Trial and error is the key to get unexpected results.
shasha3006
Contributor
Contributor
Author

hi perdro,


for status,i have calculate with fx if
if(Sum(gross)/COUNT(DISTINCT trdate)>=SUM(DISTINCT target),'new','old')
Does it affect the trdate?
while we look for it based on the period?

shasha3006
Contributor
Contributor
Author

hi deepan,
for status,i have calculate with fx if
if(Sum(gross)/COUNT(DISTINCT trdate)>=SUM(DISTINCT target),'new','old')
Does it affect the trdate?
while we look for it based on the period

sidhiq91
Specialist II
Specialist II

@shasha3006  Could you please post us some sample data?

vinieme12
Champion III
Champion III

can you post a snapshot of your datamodel ?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.