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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
kmstephenson
Creator
Creator

Using P() and Weighting/Proportion in Set Analysis

Hi All,

I'd like to use weighting/proportions in set analysis with the P() function to weight the variable used in the possible function.

EXPRESSION - Readmit Rate % for all patients, per coverage selections:

Sum({1<Coverage=P(Coverage)>}[Numerator])/Sum({1<Coverage=P(Coverage)>}[Denominator])

Coverage Type:

A

D

N

E

For example, based on my selections, let's say that the distribution of Coverage Type is the following:

Current Selections Coverage Type Distribution:

A       200

D          0

N    1000

E      100

The P() works to exclude D from the calculation - however, what if I want to weight/use proportions based on the total?

Total Coverage Type Distribution:

A      500

D    2000

N  10000

E      200

Proportion based on Current Selections/Total:

A       200/500=40%

D          0

N    1000/10000=10%

E      100/200=50%

Is there any way to account for these proportions in the expression?

Thanks!

1 Reply
sunny_talwar

I am not entirely sure I get, but may be you need this

Sum([Numerator])/Sum({1}[Denominator])