Returns true when value differs from the previous value in the ordered sequence; the first element is always true.
value: the values to compare across consecutive lines.
Examples
table T = with
[| as Id, as Category |]
[| 1, "A" |]
[| 2, "A" |]
[| 3, "B" |]
[| 4, "B" |]
[| 5, "A" |]
T.HasChanged = changed(T.Category) scan T.Id
show table "Category changes" with
T.Id
T.Category
T.HasChanged
Output:
Id
Category
HasChanged
1
A
true
2
A
false
3
B
true
4
B
false
5
A
true
Remarks
This process requires scan or sort to specify the comparison order. It works with any type that supports equality.