Generate blank row when no data is present
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am writing a workflow which breaks and sorts a data set into 4 separate parts and then generates a file for each data set. Occasionally, one of the 4 sorted data sets will have no information. I am looking to conditionally generate a blank row of dummy data when this happens. Is that possible?
Thanks!
Solved! Go to Solution.
- Labels:
- Preparation
- Transformation
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
That isn't so straight-forward. The output that you are looking for is a blank row of dummy data. Dummy data would likely need to be consistent with the data types of other output values for the fields. If you union a dummy row (make it 1st), then you can use a multi-row formula and create a NEW field "DELETE" if the DUMMY data is detected and more data is present afterwards. Then you could filter to keep/drop the dummy data if DELETE result says that more data is present. Now you can use a SELECT tool to remove the fields.
Cheers,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can use the Count Records tool like this and append it to your dataset. That ensures that even if there are zero records, one record will be created to overwrite the sheet. The value for your empty columns will be null.
If your columns are numeric, a Data Cleanse tool can be used to change the nulls to zeros.
Hope this helps.
If you don't want the Count column in your output, can can add a dynamic select tool with formula [Name]!='Count'.
Sample workflow attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Both solutions above worked for me. I went with the count record solution for simplicity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The solution above works when there are zero rows, but when i don't have zero rows, I get an error that says -- there were more than 16 records in the source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Just to clarify, the error is in the append fields tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The append tool has an option to warn or ignore (if more than 16 appends)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I also found that the Append Fields tool has a bug where if one input stream has no data that there is no output. I solved this by using the Join Multiple tool instead. That only worked in my case as I am making a 1 row data set can can join by row position.
