Skip to main content
Solved

How to backfill sparse data?


Forum|alt.badge.img

I have another newbie question please.

I am reading the input data (ID, NAME1, NAME2) in the example below and creating the new attributes FIRST and LAST.

The value of the new "FIRST" attribute is set (to NAME1) when reading the first row for a particular ID. However, the new "LAST" attribute is set (to NAME2) when processing the row associated with the last entry of a particular ID.

How do I backfill the value of the "LAST" attribute so that is available for the first row of an ID? (I need this in order to satisfy the required output format).

I am aware of the look ahead (and behind) feature in AttributeManager/Creator. However the number of rows to look ahead is not known when reading the input data. In the example below it is 2 then 4 but it could be anything between 0 .. 100+.

Example:

IDNAME1NAME2FIRSTLAST1aAAAGEFAAA1aGEFCX2CX23yXCRBX4XCR3yBX4GXO3yGXOADL3yADLDARDAR

Best answer by takashi

Hi @sunorchids, you can use the Enable Adjacent Feature Attributes option in the AttributeManager or the Attribute creator, in conjunction with conditional value setting, as in:

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

6 replies

Forum|alt.badge.img
  • Author
  • September 4, 2018

 

* look ahead is 1 then 3.

takashi
Evangelist
  • Best Answer
  • September 4, 2018

Hi @sunorchids, you can use the Enable Adjacent Feature Attributes option in the AttributeManager or the Attribute creator, in conjunction with conditional value setting, as in:


Forum|alt.badge.img
  • Author
  • September 4, 2018
takashi wrote:

Hi @sunorchids, you can use the Enable Adjacent Feature Attributes option in the AttributeManager or the Attribute creator, in conjunction with conditional value setting, as in:

Thanks for the prompt response @takashi Unfortunately I don't think my question was very clear. Your solution leads me exactly to where I am now. The desired output is below (note changes in bold to the LAST column). Note that I need to be able to access the value of the LAST attribute when outputting rows 1 and 3.

 

ID

 

 

NAME1NAME2FIRSTLAST1aAAAGEFAAACX21aGEFCX2CX23yXCRBX4XCRDAR3yBX4GXO3yGXOADL3yADLDARDAR

takashi
Evangelist
  • September 4, 2018
takashi wrote:

Hi @sunorchids, you can use the Enable Adjacent Feature Attributes option in the AttributeManager or the Attribute creator, in conjunction with conditional value setting, as in:

This workflow is a possible way. The first AttributeManager is the one I suggested above.

 

Conditional Value Setting in the AttributeManager_2

 

 


Forum|alt.badge.img
  • Author
  • September 4, 2018

@takashi again thanks for the quick response :) I will try your suggestion at work tomorrow ...


Forum|alt.badge.img
  • Author
  • September 5, 2018

Works like a charm thanks @takashi


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