Skip to main content
Solved

Taking an action if no values are passed


Forum|alt.badge.img

Hi there,

I'm having some difficulty identifying and taking actions on features where no entries are passed. Here's what my data looks like:

TYPEGEOCLASSRESTRICTIONSIGNMissing4132Incorrect3361Rework2345

Problem is, my output is an excel sheet that uses a precise template, and I need all records to be present, regardless of their values. I will be running several datasets through the workspace, all with different values missing and/or present.

So if I run data through the workspace and there are no entries that has TYPE = Rework, the output looks like this:

TYPEGEOCLASSRESTRICTIONSIGNMissing4132Incorrect3361

What I need instead is:

TYPEGEOCLASSRESTRICTIONSIGNMissing4132Incorrect3361Rework0000

So what I essentially need is to just have a test for each TYPE (Missing, Incorrect, Rework) and if there are no entries, I pretty much just need to create a blank entry (0, or _, or whatever) with the same TYPE name.

Am I overthinking this or missing the obvious?

Thanks in advance,

Best answer by takashi

Hi @robbie_botha, if I understood the requirement correctly, a possible way is: create a table listing every possible TYPE values, merge the source table to the entry table using TYPE as join key, then map 0 to the missing attributes.

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

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

I've done it like this. Set up 3 dummy features, one for each type, then use a FeatureJoiner to join them (Inner Join, but use the Left side for attribute conflicts). If there are matching features in the input the dummy features don't get used. If there are missing features in the input the dummy features will go through the UnjoinedRight port towards the output.


takashi
Influencer
  • Best Answer
  • May 16, 2018

Hi @robbie_botha, if I understood the requirement correctly, a possible way is: create a table listing every possible TYPE values, merge the source table to the entry table using TYPE as join key, then map 0 to the missing attributes.


Forum|alt.badge.img

Hi there,

I tested both options and they both work perfectly well. I decided on going with @redgeographics answer as it resonates a little more familiar with me.

Thanks for the help to both of you!


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