Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there the way to filter multogroups, relatinoships etc by maximum delta?
Comment | File | Size | Author |
---|---|---|---|
#11 | content_handler_field_multiple.only_max_delta.patch | 1.74 KB | neurovation.kiwi |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedDelta is a CCK thing. As per the submission guidelines you should probably ask there.
Comment #2
dawehnerWhat do you mean by maximum delta? What is delta here?
I know delta as the gap between two values. Alternative this could mean also the delta of a cck field.
Please describe clear, what you want to do.
Comment #3
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedHi! Yes, I mean delta of a cck field. There's something problem with last values. For example I want to expose only last value of node reference and fields from referenced node. Or I want to expose only last values of multigroups. But last value = max delta and there's no way to expose last delta through views. If there's cck problem please change project value of issue.
Thanks!
Comment #4
dawehnerYes its a feature request for the views integration of cck.
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedJust FYI, unless you already know what the last delta *is* there's no way to write a query to do this.
Comment #6
markus_petrux CreditAttribution: markus_petrux commentedCCK exposes the delta key of multiple value fields to Views, as if it was a numeric field, filter, sort, etc.
However, CCK does not allow you to choose the max value, mostly because this would require using MAX() SQL function, which is beyond the scope of what CCK can do, I think. So, as far as CCK is concerned, I'm switching this issue to support request and marking it fixed.
Maybe there's a way to use MAX() SQL function in Views 3? or contrib module?
Comment #7
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedThanks for sql idea, Markus! Unfortunately I haven't got views core knowledge, but I remember cool option "Reversed" for grouping multiple values. Do you know what it is in sql level?
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedMAX() won't work, at least, not without doing an extra query. It would be quite complex.
Comment #9
Daniel A. Beilinson CreditAttribution: Daniel A. Beilinson commentedCould you provide something like last delta function or field which can store last (maximum) value of delta?
Comment #11
neurovation.kiwi CreditAttribution: neurovation.kiwi commentedHiho,
i'm just added a patch that does exaclty that - only get the values of the max delta value.
i'm adding a subquery using max() to the where clause.
not sure if it is the best solution, it is the only one i came up with.
please feel free to review and comment!
cu
kiwi
Comment #12
mstrelan CreditAttribution: mstrelan commentedJust wanted to say that the comment (#11) from neurovation.kiwi was very handy. I needed to order by max delta value and the subquery idea definitely helped.
Comment #13
pankaj.winaim CreditAttribution: pankaj.winaim commentedYes Use this for getting max delta value in add another items .
$form[Field_name]['und']['#max_delta']