Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
Date | Product | Sales ($) | Truck | Change of truck? |
---|---|---|---|---|
29/5/2017 | Apples | 25k | A | - |
29/5/2017 | Bananas | 10k | B | - |
29/5/2017 | Lemons | 6k | A | - |
5/6/2017 | Apples | 21k | B | Yes |
5/6/2017 | Bananas | 23k | A | Yes |
5/6/2017 | Oranges | 19k | C | - |
12/6/2017 | Apples | 39k | B | No |
12/6/2017 | Bananas | 22k | C | Yes |
12/6/2017 | Oranges | 12k | A | Yes |
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
You should be able to do something like this
Aggr(If(Truck = Above(Truck), 'No', 'Yes'), Product, Date)
May be something like this?
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?
What is the difference between load and script? When you say script, do you mean expression?
yes Sunny, actually I meant expression (fx button)
You should be able to do something like this
Aggr(If(Truck = Above(Truck), 'No', 'Yes'), Product, Date)
thanks a lot Sunny,
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?