Skip to main content

I’m using FME Workbench 2023.1.  I have an excel file with a Payment Type attribute field.  There are 4 types:

  • Cash
  • Check
  • Credit Card
  • Money Order

Not all payment types will be present in the excel file each time this is run, but I need it to still have an output for that payment type.  I’m fairly new to FME and used an Attribute Filter transformer to filter for each Payment Type, but when there are no rows in my excel file with a particular Payment Type, I will not get any kind of output. See below image for example of one of the areas in my script where I use this filter.  I think I need to create a domain of values for the the Payment Type field, before this is run and maybe get a count?  In the end what I need is if there are no payments of that type in the Payment Type field, then when I sum the payment amounts for each Payment Type, that particular Payment Type would need to be given an output sum of, 0.  If you look in my below image, the only Payment Type that has an output is Credit Card, thus I will get a value for my sum.  The other Payment Types have no output.

 

 

Hi @bec I think you want the NoFeaturesTester


That does seem to work, but I would have to add it for each payment type.  I found another work around before seeing your reply that works just as well.  I created a dummy Payment Type Attribute List.  In this, I just have the 4 Payment Types in the Payment Type field and all of the other attribute values are left blank.  I then used a FeatureMeger to bring the dummy Payment Type Attribute List and the Raw Payments by Violation Report together.  When this runs, any output in the UnusedSupplier, means that Payment Type didn’t exist in the data.  So I bring both the Merged and UnusedSupplier outputs together via a Junction.  When this is finally run through the AttributeFilter for Payment Type, I get outputs for all Payment Types.  Those that didn’t exist in the original data will have a value of “0”, which is what I needed.  See below images:

 

Dummy Payment Type Attribute List with the 4 different Payment Types
FME Script showing workflow from where Dummy Table and actual Data are tied together to get all Payment Type outputs

 


Reply