Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Need to replace the null values with existing rows in sql

Ronal_bal
8 - Asteroid

Hi I need to replace the null values with values existing previously for the same Code, as these records are co-ordinates. they might not change over time. So I just need to pull the new dates with values existing in NUmber1, NUmber2 column,

Below an example, ss attached.

Screenshot 2022-06-28 104402.png


3 REPLIES 3
IraWatt
17 - Castor
17 - Castor

Hey @Ronal_bal,

A multi row formula can do this, it can grab values of the row above:

IraWatt_0-1656427841383.png

The formula checks for null, if yes grab the row above.

Any questions or issues please ask :)
HTH!
Ira

PhilipMannering
16 - Nebula
16 - Nebula

A couple of MultiRow Tools should solve this,

 

if isnull([Number1]) then [row-1:Number1] else [Number1] endif

 

And again for the number2. Be sure to group by Code column.

 

If there is only one filled value, I suppose you might get away with a Running Total Tool too. :)

grazitti_sapna
17 - Castor

@Ronal_bal, another way of solving this problem in case it occurs for multiple columns.

grazitti_sapna_0-1656428275825.png

I hope this helps!

 

Thanks!

 

Sapna Gupta
Labels