Skip to main content
Solved

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


paul_m
Contributor
Forum|alt.badge.img+6

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

Best answer by birgit

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.

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

2 replies

birgit
Influencer
Forum|alt.badge.img+16
  • Influencer
  • Best Answer
  • December 7, 2022

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.


paul_m
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • December 7, 2022
birgit wrote:

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!


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