I am looking for assistance on how to output a workflow that will create a file for each change in a location ID and will output only columns for that location where the total total sum of that column is not zero. I have attached test workflow showing how I currently have this configured for accounts receivable data. I have a list of customer ID's, by location with an AR balance by year. I am looking to report the AR balance for each customer where a new file is created for each location, but using the process below it will show all zero for a year value if any location in the source data has a value for that year.
In the attached image the Chicago file has values for all years, however the FT Wayne file does not have values for 2021 & 2022 so these columns show as all zeros. Is there a way to remove these zero sum columns when the file is being written? I could filter by location and then set the zeros back to null values and then use a data cleanse tool to remove the null columns but I am looking for a more dynamic way to do this as there are many locations in the source data and I don't want to maintain the process if a new location is added.
Thanks in advance for any and all help!