INTERACT FORUM

Please login or register.

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

Author Topic: Sorting Insanity - Can Someone Take a Look?  (Read 6499 times)

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Sorting Insanity - Can Someone Take a Look?
« on: May 16, 2015, 06:01:12 pm »

Can someone take a look at this and explain the bizarre behavior I'm seeing?

http://yabb.jriver.com/interact/index.php?topic=97418.msg674322#msg674322
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #1 on: May 16, 2015, 06:11:56 pm »

Here's the Library Backup:
<<REDACTED>>

The View in the screenshots is at Tree > Advanced\Test View.

EDIT: I took out the link to my Library Backup so I can move this to the public board.  If you want a copy, hit me up via PM.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71653
  • Where did I put my teeth?
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #2 on: May 16, 2015, 06:31:55 pm »

I'd like to move this to the beta board unless you don't agree.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #3 on: May 16, 2015, 06:33:12 pm »

Yep, that's fine.  Just not public, since it has my Library Backup in it. I put it here because I was really looking for feedback from a JRiver person.  But, I'll move it (I did already, actually).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #4 on: May 18, 2015, 05:18:43 am »

yes I'll try to load your library today or tomorrow ... I have been a little "out-of-order" this past week, personal stuff.  I have been working via PM with Denti and others here on the forum for awhile now ... as well as a bunch of people I have set up JRiver for here in france.  If I can find my "draft" (the forum doesn't have a save to draft option btw or have I missed it after all this time?!) Haven't duplicated what you have done Glynor, but I've tried similar things and there are issues, with expression sorting in category views that have made me pull my hair out for months.  (If I find the draft I'll post it here, it a couple of months old already)

You mention the swap function ... that's what I was going to actually "formally" request ... something like the a variable "8"  -- like the isequal() function has?? This would also allow people (euh like me ... that have 1000s of cds with multiple artists, album artist, composers etc.) to not have to manually swap around ";" separators too.



Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10785
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #5 on: May 21, 2015, 07:09:27 am »

Interestingly, the bug only appears if Test (Sort) is a string field, I made it a number field initially and was confused why it didn't break.
Not that it clears up the behavior much ... or maybe does it? /me goes back to the code
Logged
~ nevcairiel
~ Author of LAV Filters

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10785
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #6 on: May 21, 2015, 07:50:53 am »

I think I got it, sort of.

If the same string shows up multiple times in the Display field, then MC will try to "group" all values it shows up as, for string fields that means it outputs "[Varies]" as the sort value.
If the Sort field is a numeric, it just averages the numbers, and sorting works as expected.

It works in the earlier examples mostly "by accident", because the list of files is already pre-sorted by the sort key, because both the pane and the list of files are sorted by the same thing.

In short, its not going to work, and I don't see a way to fix that. What sort key should "L" be assigned to, if it has two values? Can't exactly average strings...
It should behave sanely if there is *no* duplicates in your Display field, or all Display->Sort field mappings are exactly the same, then there won't be any [Varies] in the output.

Obviously the second condition might work if Sort is a field derived from Display through an expression, but only if its not a List field.

Take these files:
Display: "Foo Bar" -- Sort: "Bar, Foo"
Display: "Ham Eggs" -- Sort: "Eggs, Ham"
Display: "Foo Bar; Ham Eggs" -- Sort: "Bar, Foo; Eggs, Ham"

The first two alone would work fine, and the third breaks it.
MC cannot associate individual elements with each other, since it doesn't have any way to know the relation between two fields.

So if I'm looking up all possible Sort values for "Ham Eggs", I end up with "Eggs, Ham" and "Bar, Foo; Eggs, Ham" .. and what now? Which do I use for sorting? MCs solution is to respond with "[Varies]" in such a case for Strings.
I hope that makes it somewhat clear how this simply cannot work the way you hope it would, unless I'm missing something.

This is really the same reason why the group editing dialog doesn't have a way to specify any generic field as a sort field, because it just wouldn't work in the majority of cases for string fields.
It seems kinda odd that custom sort presets do show up there. Maybe I should remove them? :)
Logged
~ nevcairiel
~ Author of LAV Filters

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #7 on: May 21, 2015, 04:39:12 pm »

It seems kinda odd that custom sort presets do show up there. Maybe I should remove them? :)

Oh god no! I use that in probably 10 or 15 different views, to sort Categories by [Date Imported] mostly, but a few other sortings.

I'll parse through what you wrote later when I have more time, but it seems pretty clear to me how it should sort: Exactly the same as the file list does (wherever the category falls highest in the results list, "wins").  There is an established sort order for strings (ascii-numeric sorting).

I don't understand why it would ever need to show [Varies], which is part of the confusion.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10785
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #8 on: May 21, 2015, 04:46:48 pm »

I don't understand why it would ever need to show [Varies], which is part of the confusion.

Thats simple: If one value shows up twice in the Display field and it creates a grouping on that, then it also has two values in the sorting field. Two values makes for [Varies] (unless they happen to match)
My previous post may have been rambling about a bit, but if you take this simple list:

DisplaySort
AD
AE
BF

If I now want to create a pane view on Display, but sorted by Sort, what Sort value would I use for A? D or E? There is no proper answer to that.
If it were numeric, it would average the numbers. But alas, strings don't do that.

One could argue for using the "smaller" of the two strings, but I'm not sure that would be any more logical (and I could cook you up an example of why, if you want)
There is a reason afterall that you have to jump through several hoops to get this view even setup this way.
Logged
~ nevcairiel
~ Author of LAV Filters

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #9 on: May 21, 2015, 05:11:00 pm »

Thats simple: If one value shows up twice in the Display field and it creates a grouping on that, then it also has two values in the sorting field. Two values makes for [Varies] (unless they happen to match)

Okay, I think I get what you mean now, but as a practical matter, I'd never want an averaged sort (even with a numeric sort field).

In my mind:
If the sort was done ascending, then the smallest number (or string value) should win.
If the sort was done descending, then the largest number (or string value) should win.

Averaging them, in a real-world usage, would be basically meaningless.

I can see that it might be very difficult (or impossible) to use a List-type value as the sort key itself, which is why I ignored that.  But I'm not sure why it can't work when using a numeric or string field as the sort key.

But, again, I didn't really parse through all of this and think about it deeply.  I mostly would want to be able to do things like:

Display a [Genre] or [Keywords] category, sorted so that the values used most recently "float" to the top. I use this a ton in my Recent Imports views.  That way, the values I've been using lately are up at the top of the categories list, and ones I used once four years ago are buried way down.  I can show practical examples of these views, using MC, if it helps.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #10 on: May 21, 2015, 05:29:38 pm »

I think I explained that last bit poorly. I'll come back later. I'm trying to make dinner and entertain a 4 year old.

As a practical matter, what I'm looking for is if you apply the Sort Order to a list of files, and look at the results, then each list type value should sort into the category list in the "spot" that matches the first time it appears in the resulting file list.

That is how the category sorting works now when used for all field types except List-Type fields.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71653
  • Where did I put my teeth?
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #11 on: May 21, 2015, 05:36:41 pm »

I think I explained that last bit poorly. I'll come back later. I'm trying to make dinner and entertain a 4 year old.
Put on Shaun the Sheep.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8971
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #12 on: May 21, 2015, 07:38:12 pm »

I mostly would want to be able to do things like:

Display a [Genre] or [Keywords] category, sorted so that the values used most recently "float" to the top. I use this a ton in my Recent Imports views.  That way, the values I've been using lately are up at the top of the categories list, and ones I used once four years ago are buried way down.  I can show practical examples of these views, using MC, if it helps.
Like keywording works in Lightroom? I have often wished MC could do something like that. Once you're two or three photos into a tagging session, Lightroom generally has the tags needed for that photoshoot right there in the nine "suggested keywords". It's pretty neat.

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #13 on: May 21, 2015, 08:07:39 pm »

This works now in Media Center, just not for [Keywords] and other list-type fields.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10785
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #14 on: May 22, 2015, 02:26:25 am »

As a practical matter, what I'm looking for is if you apply the Sort Order to a list of files, and look at the results, then each list type value should sort into the category list in the "spot" that matches the first time it appears in the resulting file list.

But I can easily make you an example where this will result in equally wrong-looking behavior.
Take the original example from the public board, trying to sort a List-type field of actors/artists by their last name:

Richard Dean AndersonAnderson, Richard Dean
Billy ZaneZane Billy

So far, so good. You can just sort them by their last name.
Now, Actors is a List field, and they appear in a movie together.

Richard Dean AndersonAnderson, Richard Dean
Billy ZaneZane, Billy
Richard Dean Anderson; Billy ZaneAnderson, Richard Dean; Zane, Billy

Now if I sort by the swapped name field, Billy Zane's "smallest" sort value is from the third entry, and it sorts under "A".
This still results in broken sorting, which is why I would rather not start touching it at all. Sorting a List field by another field is not something thats going to give you reliable results, sorry.
I'm not a fan of half-broken solutions for specialized use-cases which happen to work more by accident than by design, it makes for terrible maintainability in the long-run.

Like I said above, there is a reason the sort field in the grouping dialog doesn't usually let you select any random field, since its not going to work.
Apparently you can hack around that by using a sort preset, but I think we can safely call that unsupported rather then trying to make 1 or 2 out of 100 use-cases work, and increasing code complexity 10-fold in the process.

PS:
Because of the problems outlined above, your suggestions wouldn't even solve Denti's problem on the public board.
Logged
~ nevcairiel
~ Author of LAV Filters

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #15 on: May 22, 2015, 09:48:37 am »

The description you wrote above is completely baffling to me, and I do not follow at all.  I think because I don't get the format you're using for your tables or whatever they are.

Richard Dean AndersonAnderson, Richard Dean
Billy ZaneZane, Billy
Richard Dean Anderson; Billy ZaneAnderson, Richard Dean; Zane, Billy
What is this?  What are you trying to show here?  I don't understand it at all.

It seems like you're referring to (Denti's problem) where you need to sort by a list-type field.  I'm not talking about that at all.  You can't sort a List-Type Field used as a category.  Period.  You can, but it only works some of the time.  That's pretty clearly broken.

I'm talking about this, which is a kind of view I use all the time in all of my Libraries:

Click to embiggen.


In this view, the [Genre] and [Series] categories are sorted by the same sort order as the file listing in the view itself.  See how the [Genre] and [Series] categories "match" the file listing?  Those that are at the top of the file listing, are at the top of the Category lists.  It does not matter if they "show up" multiple times in the file listing.  They sort in the Category list to wherever they show up first in the file listing (assuming the current file listing uses the same sort order).  As I said above... This works now (screenshot is proof).

It works perfectly, and it does not need any special logic at all.  The reason that works, though, is that none of my files have multiple Genres and none have multiple Series.  If they did (if I used multiple genres, or the category I was displaying was Keywords), the category order would be random.  Or, sometimes it would be random, and sometimes it would look like this, depending on which files happened to be displayed at any one time.

But the file listing sort order would still work. It isn't like you can't sort files that have list-type fields!  Just match the freaking file listing sort order.  The logic is already defined.

I'm very confused over why this doesn't make sense.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10785
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #16 on: May 22, 2015, 10:23:19 am »

What is this?  What are you trying to show here?  I don't understand it at all.

It seems like you're referring to (Denti's problem) where you need to sort by a list-type field.  I'm not talking about that at all.  You can't sort a List-Type Field used as a category.  Period.  You can, but it only works some of the time.  That's pretty clearly broken.

Obviously I'm talking about Denti's problem. Thats the reference you used to start this thread. What else would I be talking about?
But I only used it as an example, the problem isn't related to that, but rather generic.

And actually, the problem isn't a list type field used for sorting, its when the Display field is of list-type as well.

I'm very confused over why this doesn't make sense.

I tried to explain several times why that doesn't work. As soon as one value in the pane list has two (string) sorting values assigned to it, there is no way to know which to use.
No matter which you use, its going to be wrong in all cases which don't match whatever example you use to explain it away.

So sorry, I don't see a way to change anything here which would be a clear improvement, and I gave several examples to that fact.
I could just make it use the "smallest" or "largest" string in sorting order, but that will fail on as many cases as it works, so i'm not convinced its a worthwhile change.

PS:
I'm going to assume all the pane lists in the screenshot are sorted by Date Imported, as thats what your view is sorted by, right?
Because only then this explanation makes sense.

Note that "Date Imported" has special handling in the grouping code. It always uses the "newest" date if a group summary is to be created.
There is special behavior for a few special fields. Date Imported/Last Played/Date Recorded use the "newest" logic, Duration/Filesize/Numberplays/SkipCount use a "sum" logic, all other numeric fields use an average, and String fields just produce "[Varies]" if more than one distinct value is used.

This is why your "Date Imported" view works, but there is no way to build a generic logic that works on generic string fields, logic that isn't only suitable for one example use-case, but generically useful.
In fact, most of the fields that do have special handling have a pre-defined sort preset in the grouping dialog - because they are known to work!

Even more so, using one of these special fields for sorting should work just fine with multiple values in Genre or Series as well, I don't see why that would break anything, and if it does, then that would be an actual bug.
Logged
~ nevcairiel
~ Author of LAV Filters

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #17 on: May 22, 2015, 11:11:40 am »

I'm working, so I don't have much time to look at this.  Last night I passed out, so I didn't.  I'll try to re-read what you're saying later.  I know you've tried to explain several times... I'm just not getting it.  That's probably my fault, and I'm sorry.  I appreciate you trying to help.

However, I do think we're "talking past" one another a little bit. Briefly:

* When I posted the link in this thread to Denti's thread, I linked to a specific reply in the thread. Basically, when I was trying to help him, I found what seems to be only a tangentially related issue.  Here, I wasn't trying to say "let's fix his problem" (which I don't think can be fixed), but... Hey, I found something broken when trying to fix his problem.

* I do not use any of the pre-defined sorting presets.  The one in my screenshot above is NOT the pre-defined Date Imported preset, but one I made myself (which includes [Name] so they sort alphabetically if [Date Imported] matches perfectly). It works just fine.  As do the ones I made that use [Date Modified] and [Rating] and other things.

I'm not suggesting any new fancy logic.  Just for it to follow the sort order already used in the file listing.  This should work just fine for List-Type fields too, right?

If I sort a view (ignoring categories for a minute) by [Keywords], this works fine.  The files line up with [Keywords]="Apple" at the top, and files with [Keywords]="Apple; Zebra" with them.  If I display a column with [Album], I can look at the listing and see which albums are near the top.  If I make [Album] a Category, and sort it by [Keywords] the albums in the files that are on-top of the file listing, sort to the top of that category.  It is irrelevant if they also have other junk in Keywords, because it follows the file listing, and has it show up in that same exact order.

Now, that example might not be particularly useful, but it works fine.  If I do the same exact thing, and replace [Album] with [Genre], it also works fine in my Library for Audio files.  But that's only because I'm "old school" and I "treat" [Genre] as a string-type field (no music in my Library is ever assigned to multiple genres).

But, if I do the same with my movies (which do have multiple genres from TMDB) it doesn't work.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10785
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #18 on: May 22, 2015, 11:47:27 am »

* I do not use any of the pre-defined sorting presets.  The one in my screenshot above is NOT the pre-defined Date Imported preset, but one I made myself (which includes [Name] so they sort alphabetically if [Date Imported] matches perfectly). It works just fine.  As do the ones I made that use [Date Modified] and [Rating] and other things

As long as its still the built-in Date Imported field, thats still going to use the special sort logic for the first part of the sort, anyway.

In any case, I'll think about it some more if it makes sense to monkey with something here, but as I said, I'm not convinced yet.
Logged
~ nevcairiel
~ Author of LAV Filters

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #19 on: May 22, 2015, 11:52:56 am »

In any case, I'll think about it some more if it makes sense to monkey with something here, but as I said, I'm not convinced yet.

Ok.  Fair enough.  I'll think about it more later too.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #20 on: May 22, 2015, 01:51:30 pm »

Look I don't mean to bust into your thread here, but I checked out Glynor's library ...

Do I continue here or make another thread? If so I think it best that it remains here in the Beta forum, ... your call guys.

Quote from: Glynor
It seems like you're referring to (Denti's problem) where you need to sort by a list-type field.  I'm not talking about that at all.  You can't sort a List-Type Field used as a category.  Period.  You can, but it only works some of the time.  That's pretty clearly broken.

In my understanding at least since version 16, list fields are the only way to split (is parse the term - de-concatenate?? ) separated entries via the ";". They can be sorted. It works (for data fields converted to list fields, date and numeric I don't know, don't need to really either). However, you can not display an expression that is based on multiple entries per field That is what is broken (or never worked). If you don't use list fields they will display using the semi-colon as a text character. Right? if I'm wrong, please tell me.

Quote from: Glynor
When I posted the link in this thread to Denti's thread, I linked to a specific reply in the thread. Basically, when I was trying to help him, I found what seems to be only a tangentially related issue.  Here, I wasn't trying to say "let's fix his problem" (which I don't think can be fixed), but... Hey, I found something broken when trying to fix his problem.

If Glynor of all people (compliment intended, not a slight :) ) thinks this can't be fixed (ie sorting on lastname first and displaying on firstname lastname for multiple artists, composers etc) that's pretty concerning to me. Arguably, this affects a lot more people than tweaking something to let model X Hauppage tv tuner work correctly or somebody's 15k$ monitor screen resolution. (please do not take this the wrong way - I'm in no way belittling the effort that has gone into TV and the 4K issues ....I just think the UI and the database are what affects the majority of users directly or indirectly -- especially theater and related "remote" modes based on category views)

Denti's problem is not isolated. It is also my problem as well as a bunch (20+) of people which I know that do not use this forum but bug me on teamviewer all the time, and again, arguably represent a better demographic of users than people who are vocal on this forum -- IMO of course).
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #21 on: May 22, 2015, 06:01:20 pm »

In my understanding at least since version 16, list fields are the only way to split (is parse the term - de-concatenate?? ) separated entries via the ";". They can be sorted. It works (for data fields converted to list fields, date and numeric I don't know, don't need to really either). However, you can not display an expression that is based on multiple entries per field That is what is broken (or never worked). If you don't use list fields they will display using the semi-colon as a text character. Right? if I'm wrong, please tell me.

Correct. Expressions output as string-type, and there is no &datatype=list.  It would be nice if there was, but there isn't.

That is part of why you can't do what Denti wants.  You also can't "associate" the list items in one field with those in another field, so you can't make:

Value 1 = Alt Value 1
Value 2 = Alt Value 2
Value 3 = Alt Value 3

by doing this:
[Field One]="Value 1; Value 2; Value 3"
[Field Two]="Alt Value 1; Alt Value 2; Alt Value 3"

That won't work. There's no way to do that.

And, so, even if sorting worked "right" (or what I'm calling "right") on List-Type Fields, it wouldn't do what Denti wants it to do.  I think this is what Hendrik was discussing above.  You can't sort a List Type Field using a List Type field and have the values "point at each other".  That's what I was originally thinking you might be able to do, if the values were all in the "right order", but I was wrong. It doesn't even make sense in hindsight, because logically, if you try to do the above, what really happens is:

Value 1 = Alt Value 1; Alt Value 2; Alt Value 3
Value 2 = Alt Value 1; Alt Value 2; Alt Value 3
Value 3 = Alt Value 1; Alt Value 2; Alt Value 3

(And the reverse.)
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #22 on: May 22, 2015, 06:06:13 pm »

I understand that the inability to swap names around when in a list format is a bummer.  I don't know how to solve it other than if:

* We get &datatype=list, which makes the MC UI treat the output of an expression as though it were a List-type field.
* Swap() and Unswap() are altered to handle list-type fields.

You're still going to have a rough road doing it with [Artist] though.  Because [Artist] might not always be a person's name, it could be a band name.  If you do like me, and don't use multiple-artists like that, you could pull it off now.  But you can't if you have multiple artists because you'd need to somehow "except" them from your expression.  That's what Denti was trying to solve, by brute force and typing them in manually, but you can't.

You'd need the ability to If() the Swap() function on a value by value basis (iterate over the values in the field, essentially, and check each one to see if it should be swapped).  You can't do that with MC's Expression Language.

As I was investigating it, though, I stumbled on this other bit of weirdness with List-Type fields... I'll come back to that in a bit.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #23 on: May 22, 2015, 06:31:52 pm »

So, Hendrik... Perhaps this will make what I mean more clear:

So, I can say for sure that what you were looking to do originally, cannot currently be done.  Sorry.  It comes down to the fundamental nature of the way MC handles fields.  Even if they fix what I found above, that won't help you because if you have a file tagged:

[Artist] = "Jay Random; Johnny Appleseed; Florence McFakename"
[Reverse Artist] = "Random, Jay; Appleseed, Johnny; McFakename, Florence"

Then what you've essentially done is made the value "Jay Random" equal to all three of:
* Random, Jay
* Appleseed, Johnny
* McFakename, Florence

I think this is what you were trying to show in your tables up above.  Yes, to be clear, I think if you do that, and you take the category [Artist] and then sort it by [Reverse Artist], that the logical result should be that all three of these [Artist] values: "Jay Random; Johnny Appleseed; Florence McFakename" should sort under "A".

Is that what you meant?

Yes. I agree.  That won't work well to solve Denti's (and other people's name-swapping problem).  But that doesn't mean I shouldn't be able to sort the way I was showing in the other thread.  It is doing more than that.  It wouldn't let me sort my list-type test field by a plain-old-vanilla string-type field.  But I need to concoct a different example, without confusing in all the "Display" terminology, and do some further testing.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Denti

  • Citizen of the Universe
  • *****
  • Posts: 572
Re: Sorting Insanity - Can Someone Take a Look?
« Reply #24 on: May 23, 2015, 10:35:50 am »

Thanks everyone. I'm keeping an eye on this thread, but please also keep an eye on my original thread, where a related problem is being worked through. (Note: I have been ale to do the sort and display I want using Standard View's [Name] field and the Unswap function, so it IS possible!)
Logged
Pages: [1]   Go Up