Free Trial

Alteryx Designer Desktop Discussions

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

Fill down Latest Non-Null Value in a Column

hemant86
Bolide

Hi All,

I have data in below format -

hemant86_0-1678985167633.png

I need to fill down latest non-null value. So the expected output is below

hemant86_1-1678985342942.png

I am able to achieve this using Multi-Row tool but it works only for 1 Field at a time and I have more than 30 fields to fill. Any way to use Multi-Field tool and achieve the same.

 

 

14 RÉPONSES 14
DataNath
17 - Castor
17 - Castor

Hey @hemant86, you'll be able to handle this with a single Multi-Row Formula if you Transpose your data to start with so it all sits in a single field. You can then group by your [Name] field (originally the headers i.e. Emp Code) and fill down from there. The RecordID/sort are used to maintain the split and sort of rows when you Cross-Tab your data again. I've just used a standard Select tool to fix the name and order of fields upon output but this can be amended if it needs to be more dynamic. Hope this helps!

 

DataNath_0-1678985912233.png

 

Quick edit: Had a bit of extra time so went ahead and built out the dynamic version. Upon first Transposing the data, this assigns an ascending integer value to each field name. When Cross-Tabbing, Alteryx sorts fields in ascending order so this is handled there. We then use a Dynamic Rename to lookup this integer value and replace it with the original field name that it corresponds to:

 

DataNath_0-1678986315036.png

hemant86
Bolide

Thanks @DataNath . Will check that out in my case. Thanks again for your support.

hemant86
Bolide

@DataNath The workflow you shared is working great. But when it comes to my original data set I see a issue. I guess there is something to do with the data set but not sure. I see  its overwriting the Employee ID as well or filling down i guess which should not be the case since Emp ID columns are never null. Please see the sample in the screenshot below. This is happening only with my original dataset but not with the one you have shared.

 

Original Input (Sample) -

hemant86_0-1679033187623.png

 

Output I'm getting -

hemant86_1-1679033250103.png

 

If you notice, in my case the original dataset its filling down the Emp code as well. A has Emp code =2 but its overwritten as 1 similarly C has a diff Emp code but is overwritten by 2. So its messing up the whole data.

 

Appreciate any suggestions why this is happening.

 

flying008
Aurore

Hi, @hemant86 

 

There is a similar macro of filldown from gallery:

 

录制_2023_03_17_16_03_44_340.gif

 

hemant86
Bolide

Hi @flying008 Appriciate if you could share the link to the macro. Not sure where to get it. I have downloaded a couple but its not working

DataNath
17 - Castor
17 - Castor

Hey @hemant86, any chance you can provide some more extensive sample data? I've just tried another run using the value in your screenshot above and my workflow works as expected:

 

DataNath_1-1679044199287.png

DataNath_0-1679044184593.png

hemant86
Bolide

Hi @DataNath Can you please try the attached data.

DataNath
17 - Castor
17 - Castor

@hemant86 is this the right file? Doesn't look anything like the samples above and not all Employer IDs have names to fill down:

 

DataNath_0-1679044664567.png

hemant86
Bolide

Hi @DataNath this is the right file. Just that I removed other columns. Yes there will be few columns which will not have any data to fill down. So in those cases it should stay blank since we are checking only for non-null values in a particular column. If all values in a column are null then it should ignore that column and the column should stay null.

Étiquettes
Auteurs des meilleures solutions