Drupal 8.x
I have a view returning:
- UID: 1, NID: 1, VALUE: 9
- UID: 1, NID: 3, VALUE: 8
- UID: 1, NID: 2, VALUE: 7
- UID: 2, NID: 9, VALUE: 5
- UID: 2, NID: 5, VALUE: 4
- UID: 2, NID: 7, VALUE: 3
I would like to only return:
- UID: 1, NID: 1, VALUE: 9
- UID: 2, NID: 9, VALUE: 5
My goal is to show only one row per UID which contains the highest VALUE. For this view, NID does not matter, but it is a part of the Database table and query being sent to views with hook_views_data()
and is used elsewhere.
Can the Views module accomplish this?
hook_views_query_alter()
andhook_views_data()
to create different views groups/providers from one database table and oneMYMODULE.views.inc
? Even better if you could do it without knowing what the view name or display ID would be...