Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
akuttler
Creator
Creator

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.




1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Why not add the year to you expression?

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

View solution in original post

8 Replies
sunny_talwar
MVP
MVP

Why not add the year to you expression?

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

akuttler
Creator
Creator
Author

Even better, it worked. Thanks so Much.

akuttler
Creator
Creator
Author

HI,

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

sunny_talwar
MVP
MVP

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

akuttler
Creator
Creator
Author

Yeah its called "Month Year".

sunny_talwar
MVP
MVP

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

akuttler
Creator
Creator
Author

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

sunny_talwar
MVP
MVP

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)