Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Results of Set Analysis using {1} does not match select all

Hi,

I am using Set Analysis to calculate mortality rate. For example, if the patient status is 01 (patient died), then add it to the numerator. The numerator will then be divided by the total patients admitted to the hospital.

I plan to add a grand average line (similar to the center line in the control chart), which is the grand rate across all age,gender,etc. To prevent the center line change with the field selection(date range, gender). I use the following expression:

sum({1} if (ptstatus='01',1,0))/count({1}patient)

However, the result of the above expression is different from not using set analysis by having all the fields selected.

Do you know what would be the cause and how to get the correct grand average.

Thanks a lot!

1 Solution

Accepted Solutions
AbhijitBansode
Specialist
Specialist

your problem could be because,

your data contains some records with null values.

In set analysis with {1}, records with null values are counted in aggregation.

But, since null values are not shown in lsitbox for selection, when you select all values form list box

your result will be defferent than the first one, because, records with null are not counted in aggregation.

In order to verify this, you can convert null values of the field to some meaningful symbol using NullDisplay or NullInterpret. and then try selecting all the values form the listbox.

Refer below document:

http://community.qlik.com/docs/DOC-3155

Regards,

Abhijit

View solution in original post

2 Replies
AbhijitBansode
Specialist
Specialist

your problem could be because,

your data contains some records with null values.

In set analysis with {1}, records with null values are counted in aggregation.

But, since null values are not shown in lsitbox for selection, when you select all values form list box

your result will be defferent than the first one, because, records with null are not counted in aggregation.

In order to verify this, you can convert null values of the field to some meaningful symbol using NullDisplay or NullInterpret. and then try selecting all the values form the listbox.

Refer below document:

http://community.qlik.com/docs/DOC-3155

Regards,

Abhijit

Not applicable
Author

Thank you Abhijit. It does contain NULL values