Skip to main content
Solved

Taking an action if no values are passed

  • May 16, 2018
  • 3 replies
  • 21 views

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.

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.

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+60
  • Celebrity
  • 3703 replies
  • May 16, 2018

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
Celebrity
  • 7843 replies
  • 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
  • Author
  • 70 replies
  • May 17, 2018

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!