# Distinct count in kibana

**URL:** <https://discuss.elastic.co/t/distinct-count-in-kibana/755>\
**Category:** Kibana\
**Created:** [May 15, 2015, 2:24pm UTC](https://discuss.elastic.co/t/distinct-count-in-kibana/755 "2015-05-15T14:24:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanju1323](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@sanju1323](https://discuss.elastic.co/u/sanju1323)\
**Post date:** [May 15, 2015, 2:24pm UTC](https://discuss.elastic.co/t/distinct-count-in-kibana/755/1 "2015-05-15T14:24:58Z")

</div>

Hi,

I have a serious problem with distinct count of two fields.

patientID - "1" doctor - "sanjay" test - "x"  
patientID - "2" doctor - "sanjay" test - "x"  
patientID - "1" doctor - "sanjay" test - "y"  
patientID - "1" doctor - "vijay" test - "y"  
patientID - "2" doctor - "vijay" test - "x"  
patientID - "1" doctor - "sanjay" test - "z"  
patientID - "1" doctor - "vijay" test - "z"

Here, the relation between the three fields is "patient-1 going to the doctor-sanjay for a test-x"

Now, I'm not considering test field. I want distinct count of patients for each doctor.  
Please help me in getting out of this issue.

Thanks & Regards,  
sanjay

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:19pm UTC](https://discuss.elastic.co/t/distinct-count-in-kibana/755/2 "2017-07-06T14:19:26Z")

</div>


