Solved

Taking an action if no values are passed


Badge

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,

icon

Best answer by takashi 16 May 2018, 15:54

View original

3 replies

Userlevel 5
Badge +25

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.

Userlevel 2
Badge +17

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.

Badge

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!

Reply