Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to add one more condition to Count(distinct(Date_visit_))

Hi All

I have a chart with below expression working fine :-

Count(distinct(Date_visit_))

Now i like to add filter :-

Date_year =2018

I have try below :-

Count(if(Date_year="2018",distinct(Date_visit_)))

it display null

Paul Yeo

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Try

Count({<Date_year  = {'2018'}>}Distinct(Date_visit_))

or

Count({<Date_year  = {"$(=Year(Today()))"}>}Distinct(Date_visit_))


View solution in original post

5 Replies
MK_QSL
MVP
MVP

Try

Count({<Date_year  = {'2018'}>}Distinct(Date_visit_))

or

Count({<Date_year  = {"$(=Year(Today()))"}>}Distinct(Date_visit_))


techvarun
Specialist II
Specialist II

count(DISTINCT{$<Date_year={2018}>} Date_visit_)

paulyeo11
Master
Master
Author

Hi Manish

Thank you very much for your help. I using the below expression it work fine :-

Count({<Date_year  = {'2018'}>}Distinct(Date_visit_))


Now i need to filter only those Date_month > Jan


which mean that i don't want to include 2018 Jan month only.


I have try below :-


Count({<Date_year  = {'2018'},Date_month  = {'Feb'}>}Distinct(Date_visit_))

it return only Feb value. May i know how to make it display

Count({<Date_year  = {'2018'},Date_month  >= {'Feb'}>}Distinct(Date_visit_))

Count({<Date_year  = {'2018'},Date_month  = {'>Feb'}>}Distinct(Date_visit_))

I have use the above , it cannot work.

Paul



MK_QSL
MVP
MVP

Do you have Date field here?

MK_QSL
MVP
MVP

Try something like this

Count({<Date_year = {'2018'}, Date_month = {$(=CHR(39) & Concat({1<Date_year = {'2018'}, Date_month -= {'Jan'}>}DISTINCT Date_month,CHR(39)&', '&CHR(39)) & CHR(39))}>}Distinct(Date_visit_))