Skip to main content
Solved

Aggregating, counting and creating two new fields

  • September 18, 2015
  • 3 replies
  • 185 views

Forum|alt.badge.img

Hi all,

 

I have the data in a table similar to that:

 

 

 

I have been asked to create something like the table below:

 

 

 

Basically, I am grouping by Site, Name, Feature, Subfeature, then counting Y or N for each group, concatenating the years and summing the count.

 

 

Does anyone know how to do this? By only using the aggregator I get something like that but it is not exactly but I need:

 

 

 

Any ideas how can I get Count_Dead_N and Count_Dead_Y.

 

 

Thanks!

Best answer by takashi

Hi,

 

 

I think you have almost accomplished the goal by using the Aggregtor.

 

Regarding the DEAD field, consider creating two attributes "COUNT_DEAD_Y" and "COUNT_DEAD_N" BEFORE aggregating:

 

- set 1 to COUNT_DEAD_Y if the DEAD is Y, set 0 otherwise.

 

- set 1 to COUNT_DEAD_N if the DEAD is N, set 0 otherwise.

 

You can then sum the values of the attributes with the Aggregator.

 

 

Takashi
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Evangelist
  • September 18, 2015
Hi

 

 

Have a look at the StatisticsCalculator. You probably want to set the Group By on SITE, NAME, FEATURE and SUBFEATURE.

 

 

David

 

?

takashi
Influencer
  • Best Answer
  • September 18, 2015
Hi,

 

 

I think you have almost accomplished the goal by using the Aggregtor.

 

Regarding the DEAD field, consider creating two attributes "COUNT_DEAD_Y" and "COUNT_DEAD_N" BEFORE aggregating:

 

- set 1 to COUNT_DEAD_Y if the DEAD is Y, set 0 otherwise.

 

- set 1 to COUNT_DEAD_N if the DEAD is N, set 0 otherwise.

 

You can then sum the values of the attributes with the Aggregator.

 

 

Takashi

Forum|alt.badge.img
  • Author
  • September 21, 2015
Hi Takashi,

 

 

You idea of craeating two attributes worked really well and I have achieved what I wanted to.

 

 

 

 

Thanks for that! :)

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