INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Trying retrieve all values from a given field in current selection as a list  (Read 394 times)

sparrowd

  • Recent member
  • *
  • Posts: 5

Hi there, I'm wondering if there is any expression language that would allow me to build a list of all distinct values present in a given field from a selection of files. In my case, I've built my main Categories view scheme to present Albums alongside Album "Groups" (with a user field called [ALBUMGROUPNAME]) for the sake of cleanliness. This is so I can keep b-sides and additional relevant material with the primary album, or to group together a string of live recordings, etc.
Oftentimes, these groups can contain albums that have different release dates, and I'd like to be able to have the whole group automatically be sorted by its earliest member (smallest number in the date field). This is simple enough if I can get a list built, but that's where I'm stuck. I've attached a specific example where I've changed the sorting and the text display to help illustrate the issue.

The "Live 2002-2003" group contains three different albums, with the respective dates of 11/12/02, 7/21/03, and 7/30/03. I've also populated the [ALBUMSORT] field with these dates formatted into a "yyyy-MM-dd" string. In simple terms, I don't want an average or [Varies] as a result; I want a list, and it's not as simple as plugging the field in question into the ListBuild() function.

Thanks for any suggestions or insight, even if it's assurance that I can't quite do what I'm describing.
Logged

sparrowd

  • Recent member
  • *
  • Posts: 5

bump
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2591

If I understood your question correctly, this shoould work - but it may be too slow to be usable:
FieldQuery(ALBUMGROUPNAME, [ALBUMGROUPNAME], ALBUMSORT, 1, 0)

You can get the oldest date in the list with:
listmath(FieldQuery(ALBUMGROUPNAME, [ALBUMGROUPNAME], ALBUMSORT, 1, 0), 0)
Logged

sparrowd

  • Recent member
  • *
  • Posts: 5

Thank you, I think this is exactly what I'm after. Cheers!
Logged
Pages: [1]   Go Up