Skip to main content
Solved

Aggregating, counting and creating two new fields

  • September 18, 2015
  • 3 replies
  • 217 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
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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
Celebrity
  • 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
Celebrity
  • 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! :)