Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
mhapanka
Creator
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
kingsley101
Contributor III
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

mhapanka
Creator
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

kingsley101
Contributor III
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?

Mark_Little
Luminary
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

kingsley101
Contributor III
Contributor III

Hi.

Try this...

Add this to your Table (In the load script):

// 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