Skip to main content
Solved

How to backfill sparse data?

  • September 4, 2018
  • 6 replies
  • 6 views

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:

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.

6 replies

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

 

* look ahead is 1 then 3.

takashi
Celebrity
  • 7842 replies
  • 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
  • 6 replies
  • 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:

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
Celebrity
  • 7842 replies
  • 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:

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
  • 6 replies
  • September 4, 2018

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


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

Works like a charm thanks @takashi