We're excited to announce that we'll be partnering with Credly starting October 19th - see what this means and read the announcement blog here!

Alteryx Designer Discussions

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

[Urgent]If no data/column, then create "0" into it

AndyHH
6 - Meteoroid

Hi Community!

 

I recently want to build a model which after combining two excels, if there's no data, i want to create "0" into the column, so that i can do calculation after this path. And most of the time it will have data so i can calculate directly, but if it didn't, I need to generate "0" on my own. Can anyone help for this?

 

I've tried the formula tool and type : if isempty([Sum_Amount]) then '0' Else [Sum_Amount] ENDIF. But it doesn't work.

How can i use other tool or how do i type it in the formula? Many thanks!

 

2021-10-06_18-28-16.png

 

2021-10-06_18-47-18.png

14 REPLIES 14
AndyHH
6 - Meteoroid

Hi  @danilang and thanks everyone

 

Thanks for your solution and I can generate the 0 now. However, my next step is, if there's value, i need to use my own value to ABS() to turn into positive. And if there's no value, i will want to use the generated '0' and also make it ABS().

Is there any path or formula to use? In my mind now is 1.See if value -> yes then ABS. 2. If no value -> '0' then ABS. And i will only need one figures for further usage. Many Thanks!!!

 

 

2021-10-07_14-30-45.png

atcodedog05
20 - Arcturus

Hi @AndyHH 

 

Can you show me whats in this formula that's what might be creating the issue.

 

atcodedog05_0-1633588605193.png

 

atcodedog05_0-1633588663215.png

 

Hope this helps : )

AndyHH
6 - Meteoroid

oh thanks !! i did not notice there's one formula there, i removed it and works.

However, the situation now is if there's value then it will be "value" & "counts", which in this case i dont want the counts one.

I think i can only select the first one but just want to make sure that, the data which already existed will always in the row1?

If so, i will try to select only the first row to further calculate. Thank you!!

 

2021-10-07_14-48-40.png

atcodedog05
20 - Arcturus

Hi @AndyHH 

 

You missed out the filter tool from @danilang workflow please add it and it should work.

 

atcodedog05_0-1633589638939.png

 

Hope this helps : )

AndyHH
6 - Meteoroid

Thanks everyone my question is solved!! This is really helpful !

Labels