3 Replies Latest reply: Oct 24, 2018 4:37 AM by Kingsley Hoare

# 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

• ###### Re: Set Analysis in Histogram

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

• ###### Re: Set Analysis in Histogram

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

• ###### Re: Set Analysis in Histogram

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?

• ###### Re: Set Analysis in Histogram

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

• ###### Re: Set Analysis in Histogram

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