1. Senior Member
Join Date
Nov 2013
Posts
382

## How to adjust a delivery date?

I was trying to find a simple way to do a simple calc but unable to find anything easy! I came up with quite complex manipulations for such simple problem:

Our rows contains a date and seven week-of-day boolean flags. We would like to adjust the date to the next (or same) week-of-day with true flag.

(Maybe it's too early in the morning and I'm still sleepy! )

Edited: currently I am at a CALC + FORMULA + CALC steps solution ... anything better?
Last edited by DepButi; 11-09-2017 at 06:19 AM.

2. Senior Member
Join Date
Jun 2012
Posts
5,534
Simple problem, you say?

Well, it's a mapping of a Date (prevDate) to a Date (nextDate) governed by some rules.
As such it is a computational simple problem, I agree.
A simple dataflow graph will result if we use some scripting step.
I know we can write a mapping function in Java or JavaScript.

But how would a dataflow solution look alike?
My idea is to create two sequences, one for the candi-dates and one for the control data.
There's room for improvement I'm sure.

3. Senior Member
Join Date
Nov 2013
Posts
382
We ended up with a quite simpler dataflow ...

Week2 is used to be able to issue a mail message in case there is no valid data.

4. Senior Member
Join Date
Jun 2012
Posts
5,534
You definitely improved on the number of steps involved.

PS: When concatenating those weeks, you better use [week]&[week2], and not [week2]&[week2]

BTW: week2 is mainly necessary to avoid string rotation ...
Last edited by marabu; 11-13-2017 at 06:56 AM.

5. Senior Member
Join Date
Nov 2013
Posts
382
Nope. If there is no valid date (all booleans false) I don't want to modify the original date, so [week2]&[week2] is the correct way to do it.

I just need to keep the value of [week] to test it in the next step and send a warning email to someone in case its value is '0000000'. Otherwise I would not need it.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•