INTERACT FORUM

Please login or register.

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

Author Topic: Sort by director's family name?  (Read 6124 times)

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Sort by director's family name?
« on: January 18, 2016, 11:30:33 am »

In the section Video, I've created a view Author, Date.
I would like to sort by Author's family name, not by first name.
How can I do that?
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Sort by director's family name?
« Reply #1 on: January 18, 2016, 11:47:48 am »

You would need to create a custom field. as an example you could call it [Director Sort]

to autopopulate it you can use the expression swap(...)

once you have created the field, through the tag window set it to show the new field then type and select a couple of files to test first

Code: [Select]
=swap([Director])
if this works like you want select all files and repeat so all are tagged.

Use this new field in your Views and/or sort orders

OR

you can also create the field based on the swap expression, so that this becomes fully automatic. You would be creating a calculation field in this case. I'd think this would be normally what you would want to do

to understand the "how to", please read the wiki here => http://wiki.jriver.com/index.php/Fields
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Sort by director's family name?
« Reply #2 on: January 18, 2016, 12:00:45 pm »

to autopopulate it you can use the expression swap(...)

once you have created the field, through the tag window set it to show the new field then type and select a couple of files to test first

Code: [Select]
=swap([Director])

I had started playing with this using a regex, and it was not working on special cases.  Swap() works on all cases, which is awesome!  But swap() is not documented at all.  What's up with that?  It's not in the expression language document at all.

Brian.
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Sort by director's family name?
« Reply #3 on: January 18, 2016, 12:41:45 pm »

I had started playing with this using a regex, and it was not working on special cases.  Swap() works on all cases, which is awesome!  But swap() is not documented at all.  What's up with that?  It's not in the expression language document at all.

Brian.

hey brian

You are right its not in the wiki yet ... its relatively new and Matt just fixed it a couple of weeks ago to work with semi-colon separated items, which is totally cool.

Also please note you have the corresponding unswap(...) function. The idea is that you can swap, then unswap for display expressions ... very cool indeed. However the latter can't split using the ";" correctly  http://yabb.jriver.com/interact/index.php?topic=102563.msg712224#msg712224. There is a work around, but only in Standard mode using thumbnail text. In theater view (and panes as shown in the linked thread) it doesn't split for multiple entries, but the swap and unswap are a lot easier than heavy Regex stuff.

Steve
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: Sort by director's family name?
« Reply #4 on: January 18, 2016, 12:57:26 pm »

Thanks.
I wonder how it swaps Asian (Chinese, Korean, probably Japanese) names?
Put in the Western order, those are often of the form: A B C, where A B is the first name, and C is the family name.
A and B are then 2 successive parts (typically syllables) of the first name.
(Names can also be of the form A C, where A is the firstname, and B is the family name, often a syllable each.)
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Sort by director's family name?
« Reply #5 on: January 18, 2016, 01:45:23 pm »

Thanks.
I wonder how it swaps Asian (Chinese, Korean, probably Japanese) names?
Put in the Western order, those are often of the form: A B C, where A B is the first name, and C is the family name.
A and B are then 2 successive parts (typically syllables) of the first name.
(Names can also be of the form A C, where A is the firstname, and B is the family name, often a syllable each.)
haven't a clue ... try it and tell us .. I believe it takes the last word and then flips it with some extra stuf like for Jr. and things
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Sort by director's family name?
« Reply #6 on: January 18, 2016, 03:49:55 pm »

Thanks for the extra info on swap and unswap.

Brian.
Logged

dtc

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3125
Re: Sort by director's family name?
« Reply #7 on: January 18, 2016, 04:20:12 pm »

MrC's original regex expression was the precursor to the swap() function

http://yabb.jriver.com/interact/index.php?topic=78210.msg532803#msg532803
Logged

ssands

  • Galactic Citizen
  • ****
  • Posts: 457
Re: Sort by director's family name?
« Reply #8 on: January 18, 2016, 04:23:18 pm »

What is the process to get the info in the wiki? I, for one, am an occasional user of the expression language and rely on the wiki for any info on it.

Now, I wonder if there are other functions and/or language features I am missing.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Sort by director's family name?
« Reply #9 on: January 18, 2016, 04:38:43 pm »



Now, I wonder if there are other functions and/or language features I am missing.

there are (one example is groupcount()...i'm pretty sure i've came across others whilst browsing really old forum posts)

the wiki is pretty good IMO, and what i can't find or figure out from there i've always been able to get excellent forum help

the problem with parsing things different ways (japanese names vs. western names for example) is that even the best machine languages need a pattern, and any change to the pattern messes it all up.  as to the original question, i'm willing to bet that the swap() combined with some other expressions (say to count how many words are in the name) one could build an expression that did the swap() as desired

i'm sure blgentry could whip up a real mess of a regex to do it as well


Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Sort by director's family name?
« Reply #10 on: January 19, 2016, 04:12:19 am »

What is the process to get the info in the wiki? I, for one, am an occasional user of the expression language and rely on the wiki for any info on it.

Now, I wonder if there are other functions and/or language features I am missing.
I posted this in the Wiki update thread https://yabb.jriver.com/interact/index.php?topic=86834.new#new
Logged

ssands

  • Galactic Citizen
  • ****
  • Posts: 457
Re: Sort by director's family name?
« Reply #11 on: January 19, 2016, 02:52:55 pm »

Thank you. I didn't know (or forgot) about the wiki update thread.
Logged

ssands

  • Galactic Citizen
  • ****
  • Posts: 457
Re: Sort by director's family name?
« Reply #12 on: January 19, 2016, 02:53:56 pm »

Maybe the wiki update thread should be pinned also so it shows up at the top.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Sort by director's family name?
« Reply #13 on: January 19, 2016, 03:41:08 pm »

I haven't pinned it because I bump it whenever I do major updates on the Wiki, and I figure that is easily enough noticed. There are already too many pinned threads, IMHO.
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: Sort by director's family name?
« Reply #14 on: January 19, 2016, 04:06:56 pm »

What is the process to get the info in the wiki?

For the record, I'm not sure what you meant by this question. If you just meant "how do I find stuff in the Wiki?", there are a few good ways:

* Browse around the Category Index. Most of the good articles with up-to-date information are tagged with categories now, and this is a good way to browse around the content (if you aren't sure exactly what you're looking for).

* Search. The Wiki has a built in search, which works like the search on any other mediawiki install. You can also use a custom search on Google with this URL:
https://www.google.com/#q=site:wiki.jriver.com (just add your search terms in the box to the site text there).

If you meant, how do I add stuff to the Wiki? Then, that's easy:
https://wiki.jriver.com/index.php/Help_the_JRiver_Wiki
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up