Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Row Generation Question

alexlyle
8 - Asteroid

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:

alexlyle_0-1589476936603.png

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:

alexlyle_1-1589477051815.png

It should stop at 82474 (82474/7 = 11782). How can I fix this? thanks

3 REPLIES 3
Hannah_Lissaman
11 - Bolide

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. 

 

 

alexlyle
8 - Asteroid

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?

 

alexlyle_0-1589486048801.png

 

Jonathan-Sherman
15 - Aurora
15 - Aurora

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:

 

Jonathan-Sherman_0-1589491882033.png

 

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

 

Labels