Want to auto fill blank rows, but only the next two rows following the non-empty row. How can I modify the current expression if Isempty([Counter Party ID #]) then [Row-1:Counter Party ID #] else [Counter Party ID #] endif to only auto fill the next two rows?
Solved! Go to Solution.
As always in Alteryx there are many ways to get something done. I came up with two ideas that could potentially work for you.
First, the easier one. If you sort your data so that the empty rows come first, then you can use the formula:
if Isempty([Counter Party ID #]) and !Isempty([Row+2:Counter Party ID #])
then [Row+2:Counter Party ID #]
elseif Isempty([Counter Party ID #]) and !Isempty([Row+1:Counter Party ID #])
then [Row+1:Counter Party ID #]
else [Counter Party ID #]
endif
Second, you could insert a new multi-row formula before yours that creates 1's and 2's for the rows you want to fill, something like:
if Isempty([Counter Party ID #]) and !Isempty([Row-2:Counter Party ID #])
then 2
elseif Isempty([Counter Party ID #]) and !Isempty([Row-1:Counter Party ID #])
then 1
else 0
endif
Then editing your current formula to:
if [new field] = 1 then [Row-1: Counter Party ID #]
elseif [new field] = 2 then [Row-2: Counter Party ID #]
else [Counter Party ID #]
endif
Hope this helps,
MSalvage
Hi @Dano1,
I create a sample input and workflow that may help you solve your problem, Please take a look on it.
if my proposed solution is not acceptable, please tell me back.
Thank you, that was helpful.