Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

detect field changes between dates

Hello all,

I would like to detect wether or not a field has changed between two consecutives dates.

For instance, for different products (apples, bananas, lemons and oranges), 3 trucks are used for transportation.

Because of logistical issues, we could need to change trucks. Here is an example?

DateProductSales ($)TruckChange of truck?
29/5/2017Apples25kA-
29/5/2017Bananas10kB-
29/5/2017Lemons6kA-
5/6/2017Apples21kBYes
5/6/2017Bananas23kAYes
5/6/2017Oranges19kC-
12/6/2017Apples39kBNo
12/6/2017Bananas22kCYes
12/6/2017Oranges12kAYes

How can we detect every change of truck please?

Preferably in scripts, because the load function has a loop to load several files..

Note: the first delivery on 29/5/2017 should not be considered as a change.

Many thanks in advance,

Nicolas

1 Solution

Accepted Solutions
sunny_talwar

You should be able to do something like this

Aggr(If(Truck = Above(Truck), 'No', 'Yes'), Product, Date)

View solution in original post

7 Replies
sunny_talwar

Not applicable
Author

thanks Sunny,

the proposed solution is valid mostly for a LOAD process.

Do you have any suggestion to have such a result in a script please?

sunny_talwar

What is the difference between load and script? When you say script, do you mean expression?

Not applicable
Author

yes Sunny, actually I meant expression (fx button)

sunny_talwar

You should be able to do something like this

Aggr(If(Truck = Above(Truck), 'No', 'Yes'), Product, Date)

Not applicable
Author

thanks a lot Sunny,

simon_7722
Contributor
Contributor

hi Sunny, how to do if user wants to select dates?

like previous date and current date and then wants to see if there is any change?