Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.1K Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Lookup across datasets

Posted 10 years ago
POSTED BY: Martin Currie
3 Replies

Thank you, and now that I understand how to do it & have played around with the code, I can also confirm that combining this into a single line, that avoids the need for a new parameter is possible:

Dataset[a][Select[#in == Dataset[a][Min, "in"] &], "out"]

However, both ways the output is actually {1} rather than 1

As a quick fudge to get a value out rather than a single membered list I am using

Min[Dataset[a][Select[#in == Dataset[a][Min, "in"] &], "out"]]
POSTED BY: Martin Currie
Posted 10 years ago

I just notice you wanted the out value for the minimum value of "in" --> you hav eto change the last line above to:

b[Select[#in == b[Min, "in"] &], "out"]
POSTED BY: Michael Helmle
Posted 10 years ago

create a dataset from a

b = Dataset[a]

Build a query for the value of "in"

b[Select[#in == 0 &], "out"]
POSTED BY: Michael Helmle
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard