New Transform - reference column in previous or next row

You can also Replace the values starting CLOSED with empty and then Fill down.

This is assuming that the CLOSED record doesn’t appear first. If it does you will also have to do a Sort before the Fill.

route_number.transform (2.1 KB)

@DanFeliciano Beware that Javascript has very weak ‘typing’ and may strip leading zeros off anything that looks like a number . E.g. “0708280” becomes “708280”. You can avoid this by forcing it to treat the value as a string in the Javascript.

In the near future we hope to allow something like this:

Note that this doesn’t work right now as you can’t set column variables for Value (only for THEN and ELSE).

1 Like

Thank both of you for the timely responses. I was able to complete this task over the weekend because of your suggestions.
Dave

1 Like

I was precisely going to comment on that. Doing that in the IF transformation would be very important.

1 Like

In my very first project using EasyDataTransform I had a need for this. I was able to work around it using the offset function but it would have been a lot simpler if there was a way to access values from adjacent rows.

In my case, I needed to sum values from a column for similar tags. The similar tag was below the tag it needed to be combined with. I ended up using the Dedupe function to get similarity and then Offset to ultimately get me what I needed but a simpler solution, as proposed in this thread, would have been awesome.

Hi @fatherofinvention
I am trying to understand what you are trying to do here. Are you trying to create a running total for ‘tag count’ or ‘QoH’ for each ‘Tag’ value?

Can you provide a simple input and the corresponding output that you want?

Hello. I have a list of tags and as you can see there are some duplicates, due to pluralizing, apostrophes, and misspellings, etc… So the goal was to identify these cases in my data set, which I did using the Dedupe function, and then sum their QoH values.

So you can see, baby animals and baby animal are actually the same thing, so their QoH values should be summed. I am not sure if I could have accomplished this using running total since the tag values are different. I was thinking an approach like this might work, but I could have an error in my thinking:

You can already do this with a combination of fuzzy Dedupe and Unique.

foi.transform (2.6 KB)

We may add a transform that allows you to get the value of any cell and manuipulate it using Javascript, Python etc. But most things people want to do can already be done without that.

2 Likes

Oh wow, that was just what I needed! Thank you :slight_smile:

1 Like

Glad that helped. Use the Explore Duplicates button to tweak the Fuzzy matching Closeness option.

It has been a while since I checked and I couldn’t easily find further discussion of it: did global variables or your goal of referencing an entire table of values happen? If so, could you kindly point me to the documentation or forum post? I do have a transform that could use it.

No. Being able to address a whole table in Javascript is on the wishlist for v2.