Join the Inspire AMA with Joshua Burkhow, March 31-April 4. Ask, share, and connect with the Alteryx community!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Filter

NBPSE
8 - Asteroid

How do I add a filter that picks up data that "Contains Total" OR "Is Null" / No Data Found.

 

I have 2 inputs, one will sometimes be blank, but will sometimes contain a row Total that I need to use. Currently no NULL data is coming in, it is just not bringing any data in because the worksheet is blank and therefore it is causing my basic "Filter" icon for "Filter for if Contains Total" to error out my workflow. It says "No Applicable Data Found."

10 REPLIES 10
OTrieger
13 - Pulsar

@NBPSE 
You are getting the error as no data is passing through, try the following, add Text Input with the headers only and then union the data, in this way there will always be a field that the filter can be configured.

 

head.PNG

OTrieger
13 - Pulsar

I did not try if it will work, as you might get error at the union if no data will flow from the file, but at least you can try if it will work.

NBPSE
8 - Asteroid

This did not work when I tried it

OTrieger
13 - Pulsar

This will work, just do not forget to remove Count later on

ddddd.PNG

NBPSE
8 - Asteroid

Are you able to upload this workflow? I am not sure how this is creating data.

OTrieger
13 - Pulsar

@NBPSE 
I cannot do that, just add the parts that are missing at your WF compared to the snippet that I uploaded.

 

Just to clarify it, it is not my private license therefore will not be able to share any WFs, can share snippets and add explanations. I do believe that you have a WF in place, I added 3 tools, Text Input, Count and append, you should be able to manage it.

jirikrecek
8 - Asteroid

I was wrecking my brain on this a few years back when needing to send an automated email, if a file was read empty.
There is a super simple trick using the same logic as @OTrieger suggested.
But one major difference:

  • in your dummy files, do not just include the headers and nothing with it. It won't work as you already saw
  • What you need to do is to add at least one row in that dummy file, something like "No Data" or "File Empty"
  • What will happen now that if your data file is empty and you union the dummy file, which will always have 1 record saying "No Data", it will ALWAYS run the flow.

I did the following and it worked flawlessly:

  1. union your dummy header file to your data + have a 1 record in it saying "No Data"
  2. Add record ID
  3. Summarize tool will help you find the MAX value of that record ID
  4. Append this maxvalue to your data with Append tool
  5. Now you have your original data and also a column, which tells you how many records you have
  6. Add  filter where you tell it to only pass records where:
    1. Max Record ID is > 1 and Org column is different != than "No Data"
  7. What this does is: if there is no data and only the headers are pushed, your result will say No Data
  8. if there is data in your file, then the No Data first row will be hidden and only your live data will be passed

 

I used this before and it works perfectly. It helped sending me emails to alert my customer to let them know that their source file came in empty that night.

 

Screenshot 2025-02-24 164435.pngScreenshot 2025-02-24 164350.pngScreenshot 2025-02-24 163911.pngScreenshot 2025-02-24 163844.png

NBPSE
8 - Asteroid

This was a fix that worked for me, thank you so much!

jirikrecek
8 - Asteroid

I received a message from you @NBPSE, but when I went to this discussion it just vanishes.
If I understood correctly, you want to do a join afterwards and want to get rid of the NO DATA row, if there indeed is data.
All you have to do here is to add a filter to look for a value NO DATA in the column
This filter tool will split your flow into two branches

  • T anchor will send it to the situation where there was no data and only a row with a value NO DATA will be there
  • F anchor of the filter will have a situation where there is NO DATA row + actual data - this is the one you want

 

So, either way that last filter will show you either NO DATA or will show the actual data itself and you are golden from there onwards

Either of the branches may need some sort of action - send email, write a file, etc...
Just because there was no data doesn't mean nothing happens - you can still write an empty file with hardcoded text in it, etc...

Labels
Top Solution Authors