Skip to content

name ArgMax= column? #82

Answered by EvgSkv
tkawachi asked this question in Q&A
May 14, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The value is simply interpreted as a column named logica_value.
To put the result of ArgMax to the title column we can do as follows.

History(id: "A", change_date: Date(2021, 4, 1), title: "A-title2");
History(id: "A", change_date: Date(2021, 3, 1), title: "A-title1");
History(id: "B", change_date: Date(2021, 3, 1), title: "B-title1");

Latest(id:, title? ArgMax= title -> x) distinct :- History(id:, title:, change_date: x);

The arrow notation a -> b is simply a nice way to write {arg: a, value: b} and the ArgMax aggregation function takes such record as an argument, returning arg which has the largest value.

Please let me know if you have further questions.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tkawachi
Comment options

Answer selected by tkawachi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants