Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Set Analysis in Load Script

There are many different types of patient visits that our healthcare organization has, but they are not defined within our source system. Therefore, within my layer 2 I created flags to use within set analysis to perform a count on these types. However, we want to also be able to define these types so they can be utilized in a filter like a standard dimension.  

In short, how do I take these two formulas and make it a field name of Visit Type with potential values of Work Comp or Urgent Care Visit?

Work Comp expression: Count({<WCFlag={1},ESPFlag={0}> + <OccMedFacilityFlag={1},ESPFlag={0}>}distinct EncounterID)

Urgent Care Visit expression: Count({<WCFlag={0}, ESPFlag={0}, IEFlag = {1}>}distinct(EncounterID))

1 Reply
Creator III
Creator III


you can use if for that:

if(WCFlag = '1' and ESPFlag = '0' and IEFlag  = '1' , 'Urgent Care Visit'

if(........................................., 'Work Comp ', null())) as [Visit Type]