Solved

How do I create a summarize step in my flow?


Badge

I have a flow as pictured below. I have only three collumns in my StatisticsCalculator. I have year, month, amount. What I want is to create a sum(amount) per year, month. When I run this flow it generates way to mcuh data. I was expecting 12 rows pre year but there is way more and the data is duplicate, giving 28 rows per month. What am I doing wrong?

image

icon

Best answer by redgeographics 8 July 2022, 11:25

View original

6 replies

Userlevel 4
Badge +25

If you group the StatisticsCalculator by year and month it will output one summary feature per unique combination of those two attributes, so if you have a full year's worth of data you can indeed expect to see 12 output features.

 

You mention you get 28 rows per month, but I don't see that in the feature counts to be honest. Where are you seeing those?

Badge

If you group the StatisticsCalculator by year and month it will output one summary feature per unique combination of those two attributes, so if you have a full year's worth of data you can indeed expect to see 12 output features.

 

You mention you get 28 rows per month, but I don't see that in the feature counts to be honest. Where are you seeing those?

When I run a sql query at the table this is what the result look like

I truncate the table before I run the flow in FME to ensure I do not have any wrong data begfore start.

image

Userlevel 4
Badge +25

When I run a sql query at the table this is what the result look like

I truncate the table before I run the flow in FME to ensure I do not have any wrong data begfore start.

image

The screenshot shows only 12 features being written. Can you doublecheck the table handling parameters (is it maybe inserting rather than updating so that there's still old data in there?)

Badge

When I run a sql query at the table this is what the result look like

I truncate the table before I run the flow in FME to ensure I do not have any wrong data begfore start.

image

The writer was sett to use exisiting so I now set it to Truncate.

Now I see that the table is truncated but now it does not receive any data.

Will ned to look into that one now. Thanks for your help so far, will get back to you once I figure out why it does not write to the database now.

Badge

When I run a sql query at the table this is what the result look like

I truncate the table before I run the flow in FME to ensure I do not have any wrong data begfore start.

image

After a bit of search I found that the trouble was actually in the database.

Thanks for you valuable input.

Userlevel 4
Badge +25

When I run a sql query at the table this is what the result look like

I truncate the table before I run the flow in FME to ensure I do not have any wrong data begfore start.

image

You're welcome!

Reply