Skip to main content
Question

Variable setter?

  • December 10, 2019
  • 2 replies
  • 44 views

ayraju
Contributor
Forum|alt.badge.img+1

Hi,

I am trying to use FME to get some excel data formatted into columns so I can use them for analysis. The problem is there are headers which I need to populate as a column.

I can clean out the totals and blank rows with tester filter but I am not sure how to get the C HALL at the top of the group to populate in a column.

I tried using variable setter but it gives me C Hall all the way through for all the lines. Any help is appreciated.

 

So I need the attached data to look like this -

C HALL4/1/2019

 

 

 

 

DATEEVENTROOMATTENDANCETotalEventsEvent Location4/1/2019Event ABuilding C121C HALL4/5/2019Event BBuilding C251C HALL4/11/2019Event CBuilding C3001C HALL

 

 

 

337

 

 

D HALL

 

 

 

 

 

DATEEVENTROOMATTENDANCETotalEvents

 

4/15/2019EVENT 1P1201D Hall4/22/2019EVENT 2P1401D Hall4/6/2019EVENT 3P2401D Hall

 

 

 

100

 

 

R HALL

 

 

 

 

 

DATEEVENTROOMATTENDANCETotalEvents

 

4/15/2019EVENT FC1101R Hall4/22/2019EVENT GC2101R Hall4/6/2019EVENT HC1151R Hall

 

 

 

25

 

 

 

 

2 replies

sipsysigh
Contributor
Forum|alt.badge.img+7
  • Contributor
  • December 10, 2019

Hi @ayraju

An alternative to using the VariableSetter / VariableReceiver combination might be to use a couple of AttributeCreators that make use of Advanced: Attribute Value Handling to populate the correct Event Location for each row?

In the AttributeCreator you can create your Attribute Value using a Conditional Value that uses logic based on Adjacent Feature Attributes. I have attached an annotated template workspace file that I hope explains what I have done and also solves your problem!

The 2 screenshots below only show the settings for first AttributeCreator transformer. This is just to give you an idea of the technique being used. Please see the attached template workspace for the full workflow along with a brief explanation of what is going on.

Opening up the settings of the AttributeCreator, you need to expand Advanced: Attribute Value Handling and Enable Adjacent Feature Attributes.

Below is the associated Parameter Condition Definition that determines the Attribute Value for your New Attribute 'F' in the above dialog:

 

Thanks,

 

si

eventlocation.fmwt


ayraju
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 11, 2019

Thanks, yes that was the alternate solution which I am currently using but I was hoping to see if it possible to use variablesetter. thanks


Reply


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