Skip to main content
Solved

How do I calculate the total number of occurrances of values in a list?

  • December 11, 2023
  • 3 replies
  • 220 views

stu_home
Contributor
Forum|alt.badge.img+5

I have a column of health conditions for individual patients.

Often patients have multiple health conditions. If they have more than one, then the conditions are seperated by a ; (Some patients have up to 5 separate conditions)

I need to find out how often individual health conditions feature. ie how many times is "Arthritis" listed as one of the health conditions?

 

I've used the Attribute Splitter, using the ; as the delimiter. This creates a list of the health conditions, I've named the list "Health_Conditions".

 

I now want to find out the number of times each health condition appears in the list / exposed values of the list. ie how many times does eg "Arthritis" appear? And how many times does "Diabetes" appear?

 

Note: From the screen shots below you can see health conditions can appear in any of the exposed value lists{}

 

I've tried Statistics Calculator, Counter, ListHistogrammer but can't get the result I am looking for. Many thanks in advance for any words of wisdom.

 

Stuart

Best answer by panda

I think you need to do list exploder to put them as separate feature. And then you do test filter where Health condition contain the word Arthritis. Then you can do statistic calculator on counter (i think) and make sure you have group processing on by patient ID or something that is unique that represent each patient. and in completed port, there should be counter attribute showing how many arthritis showed for each unique patient. Hope this help, cheers!

View original
Did this help you find an answer to your question?

3 replies

panda
Enthusiast
Forum|alt.badge.img+17
  • Enthusiast
  • Best Answer
  • December 12, 2023

I think you need to do list exploder to put them as separate feature. And then you do test filter where Health condition contain the word Arthritis. Then you can do statistic calculator on counter (i think) and make sure you have group processing on by patient ID or something that is unique that represent each patient. and in completed port, there should be counter attribute showing how many arthritis showed for each unique patient. Hope this help, cheers!


stu_home
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • December 12, 2023

Panda, thank you so much, you're a star.

I'd previously looked at both List Exploder and StatisticsCalculator but hadn't got the answer I was looking for. So after your recommendation I looked into it further: used ListExploder first then onto StatisticsCalculator, tinkered around with the options of the latter and the nail was hit on the head!

Much appreciated.


panda
Enthusiast
Forum|alt.badge.img+17
  • Enthusiast
  • December 12, 2023
stuarmitagehome wrote:

Panda, thank you so much, you're a star.

I'd previously looked at both List Exploder and StatisticsCalculator but hadn't got the answer I was looking for. So after your recommendation I looked into it further: used ListExploder first then onto StatisticsCalculator, tinkered around with the options of the latter and the nail was hit on the head!

Much appreciated.

You're welcome! Glad that works :)


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings