This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I am reading in a fixed width file that has header,detail record, and trailer components,I ultimately want to write these to HDFS. If the detail record component has 0 records there will be no output for the associated Alteryx field names. I need to output all fields even if there aren't detail records in the fixed width file. Anyone have a clue how I might go about this?
Can find a specific example, but (from memory) one technique I've seen is to create a Text Input tool with a single record of NULL values in the fields.
You can then Union that with the existing workflow (which will then provide at least one row of data). You of course then don't want that record in your data if you actually do have data, but again from memory, if you order the Union to first take the "real" data and then union the "fake" record data, you can test in a to see if the first record has NULLs and if not, then filter out all NULL records (which would be the one at the bottom out of the Union).
Sorry it's not more exact, but thought I'd at least throw this out as something you could try. :-)
Thanks @RodL. Jsut curious what if I have automated workflows and I have the intermediate outputs as YXDB files, do we have an option inbuilt to allow the file to be generated even if there are no records out? At times I had to revisit few workflows to change the existing setup and revert back when this scenarios doesn't happen.
A simple checkbox to allow just the headers with null data would a great add on. what do you think?