Hi,
I have a workflow that outputs multiple tabs into an excel. There is one particular tab where sometimes you won't have any data and sometimes there is data. Wanted to see if there is a way to write the data if there is one and if it's blank then just output the headers.
Example:
If the workflow output contains data then
Branch Customer ID Segment
BR123 23244 NU
If workflow output contains no data then
Branch Customer ID Segment
Solved! Go to Solution.
Hi @aparna0208,
Please check my solution.
What I have done is use the count records tool to create at least one line of the text. The workflow should output just headers if that situation will show up.
Hi @aparna0208 - In Alteryx almost everything can be done in a couple of different ways. My approach is to push headers down as the first row of data and configure the output data tool to skip field names. You can Union by position with your data and you will not need to perform any checks.
@Emil_Kos Thanks for your inputs. I tried this but still not getting the expected output(blank headers)
@ArtApa This actually works when I configure output data tool to skip field names. The problem is I have multiple tabs writing to an excel and this is just one tab so I don't think I'll be able to configure the output tool as it would impact other tabs.
Hi @aparna0208
Here is a modification of @Emil_Kos workflow which will work. Let me know if you face any issues.
Workflow:
Hope this helps : )
Hi @aparna0208
I got a better understanding now. You want to write to multiple tab with a single output tool. Below is how you can do it.
Workflow:
Hope this helps : )
Thank you @atcodedog05 The problem is in the formula tool. IF condition with [Branch ] format throws error stating Branch is unknown variable. When I give space after branch I get this error
Hi @aparna0208
You would just need to rename the variable in the formula to the actual column name. If column name is "Branch" then use [Branch] in formula tool.
Hope this helps : )
@atcodedog05 Perfect this worked! I just wanted to know if there is a way to tweak this so that if there is any data then write that to the excel if not output blank headers
User | Count |
---|---|
52 | |
27 | |
25 | |
24 | |
21 |