Is there the way to filter multogroups, relatinoships etc by maximum delta?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Delta is a CCK thing. As per the submission guidelines you should probably ask there.

dawehner’s picture

Status: Closed (won't fix) » Postponed (maintainer needs more info)

What 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.

Daniel A. Beilinson’s picture

Hi! 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!

dawehner’s picture

Project: Views (for Drupal 7) » Content Construction Kit (CCK)
Version: 6.x-2.8 » 6.x-2.x-dev
Component: Miscellaneous » Views Integration

Yes its a feature request for the views integration of cck.

merlinofchaos’s picture

Status: Postponed (maintainer needs more info) » Active

Just FYI, unless you already know what the last delta *is* there's no way to write a query to do this.

markus_petrux’s picture

Category: feature » support
Status: Active » Fixed

CCK 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?

Daniel A. Beilinson’s picture

Thanks 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?

merlinofchaos’s picture

MAX() won't work, at least, not without doing an extra query. It would be quite complex.

Daniel A. Beilinson’s picture

Could you provide something like last delta function or field which can store last (maximum) value of delta?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

neurovation.kiwi’s picture

Category: support » feature
Status: Closed (fixed) » Needs review
FileSize
1.74 KB

Hiho,

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

mstrelan’s picture

Just 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.

pankaj.winaim’s picture

Yes Use this for getting max delta value in add another items .

$form[Field_name]['und']['#max_delta']