Replacing specific value with value from corresponding cell

3 posts / 0 new
Last post
BigBang
Offline
Joined: 06/28/2019 - 12:37
Replacing specific value with value from corresponding cell

Hello,
I am currently wanting to replace all the cells in one column (column A) that have a value of "0/00/000" with a value in the same row from another column (column B).
Basically, if Column A Cell 1 = "0/00/0000" then replace Column A Cell 1  with Column B Cell 1. I am very new to IDEA but I thought appeneding a new field with the following was a good start.
@If( ColumnA == @Ctod("0/00/0000" , "D/MM/YYYY"),   ColumnB )
I have tried a few other things that I thought might get me close to no real effect. Any ideas?
 
Thank you,

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi BigBang and welcome to the site.

From you equation I am assuming that it is a date field?  Also that the field you are appending to (creating) is also a date field?  I am going to go with these assumptions for your solution.

Date fields are alway stored within IDEA as YYYYMMDD, what you see on the screen depends on your windows regional preferences but in the background it is stored as year - month - day.  So for your equation it should probably be something like this:

@If(ColumnA == "00000000", ColumnB, ColumnA)

Like I said this assumes that Column A and B are date fields and you are creating a date field.  So you check if the first is blank (all 0s) and if it is blank you replace it with ColumnB if not you put ColumnA back in there.

Let me know if this is what you are looking for.

Brian

BigBang
Offline
Joined: 06/28/2019 - 12:37

Brian, this is exactly what I was looking for. Thanks for the welcome. Thank you!