Solved

How to create a count that changes based on preceding empty values in a dataset?

  • 7 December 2022
  • 2 replies
  • 0 views

Badge +1

I'm trying to create a count that changes whenever it sees an empty row in a dataset. For example, I have the first 3 columns and would like to create a column similar to Test2 (see image below) that has a new count whenever there is an empty value in Test in the preceding row. Any ideas would be greatly appreciated!

Example

icon

Best answer by birgit 7 December 2022, 17:10

View original

2 replies

Badge +9

AttributeCreators have the option to "Enable Adjacent Feature Attributes" which allows you to use the values of attributes which precede or follow the current feature. I have a working example for you that does what you describe here. The biggest problem here is that there can be multiple features that can have no value for the "Test" attribute which meant that I needed an extra AttributeCreator to get the desired result.

Badge +1

AttributeCreators have the option to "Enable Adjacent Feature Attributes" which allows you to use the values of attributes which precede or follow the current feature. I have a working example for you that does what you describe here. The biggest problem here is that there can be multiple features that can have no value for the "Test" attribute which meant that I needed an extra AttributeCreator to get the desired result.

Thank you! I was able to use the example you provided with a couple changes to deal with missing/null to get it to work with my full dataset. I appreciate the help!

Reply