Substract actual Value from previous Value under certain conditions

Hello, I’m trying to duplicate another work flow i found that has the same problem to my solution, but I’m running into some hiccups. This is the flow I’m attempting to copy: Substract actual Value from previous Value under certain conditions

I’ve shared my flow. The group of nodes at the top is the flow I’m attempting to duplicate. The group below is working with my data.

The following is my issue. I’m attempting to create a filter via string manipulation variable node, like the original. It seems like I’m doing exactly what I need to do, but I’m not yielding any filtered results. I’m assuming it has to do with the date format, but I do not understand how to fix this.

In my flow, I’m converting my date into a string like the original, but I think ideally, I’d keep this as a date throughout.

Please help! Thank you.

Conditionally substract current from previous value 2.knwf (106.3 KB)

Could you describe what you’re trying to do, i.e. what is the input and what is the expected output?

that would probably be helpful.

i have data consisting of placement name, demo group, and tracked ads. the tracked ads are logged cumulatively by date. i need to calculate the number of tracked ads for each placement name, per demo group, each day.

i discovered this flow which is doing exactly that, the problem is they do it by period, im doing it by date and the format of the columns is throwing me a curve ball.

Hi,

It’s really hard to tell what’s different in your approach if you do not share the data.

Andreas

I apologize. I probably did not share it properly. I exported my workflow and attached it to original post. What’s the best way to show you my flow and data?

No worries.
The easiest way is to save the data within the workflow data area.

  1. Go with you file browser to the workspace folder and then to your workflow.
    In my case it would be in: “C:\Users\andi\knime-workspace\Forum\Kyleengs_Question”
  2. Create a folder called “data”
  3. Copy the excel file and/or the csv file to this folder
  4. Change settings of the file/excel reader to:
2 Likes

thank you! i hope i did this properly. flow attached w data… couldnt edit my original post unfortunately
Conditionally substract current from previous value 2.knwf (108.8 KB)

I actually solved my issue… in the original flow, the creator used “=” for their conditional statements even though they made their integer a string

I was able to create a working statement: $Classification$ = “x,Persons 2+” AND $Date$ = “2025-01-04” => TRUE

i dont understand why the creator didnt encapsulate their period, an integer converted to a string, in quotes, but i did solve my issue

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.