I am trying to use Alteryx to generate rows, preferably blank (but I can make them blank if need by) so that the total count of my rows is divisible by 7. Here is my method:
1. use summarize to determine the largest row ID
2. join a formula tool and add 1 to it
3. join generate rows and configure as follows:
but, this cuts off 1 short of 7. Ex: my max row is 82469. I add 1 to it and run the generate rows tool. I get the following:
It should stop at 82474 (82474/7 = 11782). How can I fix this? thanks
Solved! Go to Solution.
Hi @alexlyle
The 'Condition Expression' part of the Generate Rows tool needs an expression which evaluates to either True or False. The expression you have entered is not designed to create a True or False result, so will not produce the desired result.
The clearest way to do this is to add a Formula tool, and to calculate your target number of rows before the Generate Rows tool. I used the expression: [Max Row] + 7 - Mod([Max Row],7). In the Generate Rows tool, you can then use the Condition Expression [RowCount] <= [New Max Row] to tell it when to stop generating. See attached example.
To explain the result you are seeing: False can also be written as 0. When the result of your MOD expression is a number higher than 0, it continues generating rows. When you reach your target number and the MOD is 0, Alteryx reads this as 'False' and stops creating rows.
Thanks Hannah,
Now, I'm trying to figure out how to get mod to increase incrementally- go 3,4,5,6,7. I'm trying multirow formula with no luck. any suggestions?
Hi @alexlyle,
I've got two ways for you to get to that outcome - personally i prefer the first, however the second is the way you could do it with the multi-row formula tool:
If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.
Regards,
Jonathan