Hey, I want to obtain the count of patients based on their visit number

Hey, I am , trying to calculate the count of patients for their 2nd and 3rd visits. In the provided image, the Rank value of 2 represents the second visit for a patient, while the Rank value of 3 represents the third visit. I want to obtain the count of patients based on their visit number.

image

Hi @Abhishek_24

can you convert the Rank into a string using toString function, and then do a count distinct on the new calculated field (string)?

Hope it helps,
GL

Hi @gillepa , I did as you said, but due to custom filed, unable to do count distinct.
It didn’t helped, to achieve me what i want. Is there anything else we can try to achieve?

I would suggest doing this rank in SQL instead of quicksight. Then you can use that column as a group and it should be very easy to count over it in quicksight.