Skip to main content
Question

AttributeCreator getting "Bad variant index in get" when setting default value to adjacent feature attribute


Forum|alt.badge.img

Trying to set "WeekOfMonth" attribute for ALL features based on attribute "feature[-1]._4weekly_cycle" value, which today is "2". I am using the adjacent feature attributes capability in "AttributeCreator" transformer. Getting "Bad variant index in get" error in log file. If I set default value to "2", it works. Something not write with handling "feature[-1]._4weekly_cycle" value.

10 replies

Forum|alt.badge.img
  • Author
  • October 10, 2018

screenshot1.png


Forum|alt.badge.img
  • Author
  • October 10, 2018

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • October 10, 2018

I think this could be a problem with the first feature, since there will never be a previous feature for the first feature. Try using a conditional formula for the attribute value to handle the first feature


Forum|alt.badge.img
  • Author
  • October 10, 2018
ebygomm wrote:

I think this could be a problem with the first feature, since there will never be a previous feature for the first feature. Try using a conditional formula for the attribute value to handle the first feature

Thanks, I tried using a conditional. That did not help.

 

conditional.png

 

 


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • October 10, 2018
blucas01 wrote:
Thanks, I tried using a conditional. That did not help.

 

conditional.png

 

 

I've looked at the workspace now, I don't think you want the adjacent attribute handling. Do you just want to add the calculated Week of the Month to every feature coming out the first part of the workbench?

 

 


Forum|alt.badge.img
  • Author
  • October 10, 2018
ebygomm wrote:

I think this could be a problem with the first feature, since there will never be a previous feature for the first feature. Try using a conditional formula for the attribute value to handle the first feature

I tried doing that. Did not change anything.conditional.png

 

 


Forum|alt.badge.img
  • Author
  • October 10, 2018
ebygomm wrote:
I've looked at the workspace now, I don't think you want the adjacent attribute handling. Do you just want to add the calculated Week of the Month to every feature coming out the first part of the workbench?

 

 

Yes. Just add the calculated Wek of the Month to every feature.

 

 


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • October 10, 2018
blucas01 wrote:
Yes. Just add the calculated Wek of the Month to every feature.

 

 

I would just use a featuremerger for something like this, so all features going into the requestor, your calculated Week of the Month to the supplier and use 1 on both sides of your Join, e.g.

 

 

 


Forum|alt.badge.img
  • Author
  • October 10, 2018
ebygomm wrote:

I think this could be a problem with the first feature, since there will never be a previous feature for the first feature. Try using a conditional formula for the attribute value to handle the first feature

I'll try using the featuremerger. Thanks for the example. I've never used FeatureMerger.

 

 


Forum|alt.badge.img
  • Author
  • October 10, 2018
ebygomm wrote:

I think this could be a problem with the first feature, since there will never be a previous feature for the first feature. Try using a conditional formula for the attribute value to handle the first feature

That worked! Thanks. I really appreciate your time in looking at it. I figured there was a better way to merge the data, I did not realize you could use the featuremerger that way without unique keys. Thanks.featuremergeradded.png

 

 


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