cancel
Showing results for
Did you mean:
Creator

## Set Analysis in Histogram

I have two groups of peopIe under the field group. A and B

need to make a histogram in which I want the average blood pressure(filed BP) of people who belong to A and another histogram with the average blood pressure of people who belong to A.

How do I code this using set analysis?

Thank you

5 Replies
Contributor III

Hi Mallika.

I assume you are looking for the frequency of A people in different BP intervals and the same thing for B?

Please can you explain the scenario a bit more

Creator
Author

Yes , I am looking for one histogram with BP levels of only A people and another histogram with BP levels of only B people.

How do I use set analyses to achieve this?

i tried : =({\$<[Control]={'Control'}>}[ED DBP])

and  =Avg({\$<[Control]={'Control'}>}[ED DBP])  as well but didnt work

Contributor III

Hi .I think you may need an aggregate function. Are you able to post the qvw or qvf so I can try it on my side first?

Luminary

Hi

Probably something like

AVG({<[Field Group]={'A'}>}[ED DBP])

AVG({<[Field Group]={'B'}>}[ED DBP])

I am not sure if i have the field names correct though.

Mark

Contributor III

Hi.

Try this...

// This will create a dual. This function will create buckets for us with an increment of 25 (just change 25 to whatever interval you'd like)

DUAL(FLOOR(BP, 25) & '<= BP <' & FLOOR(BP, 25)+25, FLOOR(BP, 25)/25) as ABC

Create a bar chart

Dimensions:

ABC

Expression:

Count({<Control={'A'}>} ABC)

It should sort automatically, But if not, then sort by ABC

Please note I haven't tested this. Let me know.

Thanks

Kingsley