Alteryx Designer Desktop Discussions

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

Generate rows on an empty table

pinecone
6 - Meteoroid

Hi, 

 

I have a workflow that goes through a lookup on a database table to find max primary key, to be able to continue adding key values from max PK to my new records. However, I want to be able to handle a scenario where my table is all blank/empty. How can I generate 1 row on a table with 0 records? I have tried both MultiRowFormula and GenerateRows to do so, but I can't seem to figure it out. 

 

Does anyone have a suggestion?

 

 

2 REPLIES 2
apathetichell
18 - Pollux

Use a count records tool - it returns 0 when there are no records. use a filter to test if there are 0 records. if there are not- append the count to the existent original data stream and do what you need to. If the are 0 records - create the record.

gaoa
11 - Bolide

Hi @pinecone 

One way of doing this: I made a small adjustment to use Generate Rows tool as a "standalone" dataset (not connected to the input tool) so it generates as many records as you like. Then Append the new records to the original PK column. You can then replace the Null values in the PK column using a Formula tool.

 

 

gaoa_0-1677688067316.png

 

gaoa_1-1677688718321.png

Labels