Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

akuttler
Contributor

Set Modifier used with a Variable

I am new to Qlik and I am having trouble with an expression:

1) Sum({$<Year={2017}>}$(VCountNewPatients))

Where vCountNewPatients = Count({<CPT={'99201','99202','99203','99204','99205'}>}Distinct PATIENTID)

I am trying to sum the #  of New Patients in 2017. But 1) expression comes back as null.

CPT =99201','99202','99203','99204','99205 refers to New Patient office visits .


I cant figure how to use a set a modifier with the CountNewPatients Variable.




Tags (2)
1 Solution

Accepted Solutions
Highlighted

Re: Set Modifier used with a Variable

Why not add the year to you expression?

Count({<CPT={'99201','99202','99203','99204','99205'}, Year = {2017}>}Distinct PATIENTID)

8 Replies
Highlighted

Re: Set Modifier used with a Variable

Why not add the year to you expression?

Count({<CPT={'99201','99202','99203','99204','99205'}, Year = {2017}>}Distinct PATIENTID)

akuttler
Contributor

Re: Set Modifier used with a Variable

Even better, it worked. Thanks so Much.

akuttler
Contributor

Re: Set Modifier used with a Variable

HI,

How do I write the expression but for a specific date range instead of year...like Jan-Oct 2017?

Re: Set Modifier used with a Variable

Do you have a date or monthyear field? What is it called?

akuttler
Contributor

Re: Set Modifier used with a Variable

Yeah its called "Month Year".

Re: Set Modifier used with a Variable

Can you share the script used to create it in the back end of the app?

akuttler
Contributor

Re: Set Modifier used with a Variable

Date(MonthStart("Transaction Date"),'MMMM YYYY') as "Month Year",

Re: Set Modifier used with a Variable

May be this

Count({<CPT={'99201','99202','99203','99204','99205'}, [Month Year]= {"$(='>=' & Date(YearStart(Max([Month Year])), 'MMMM YYYY') & '<=' & Date(Max([Month Year]), 'MMMM YYYY'))"}>} Distinct PATIENTID)

Community Browser