INTERACT FORUM

Please login or register.

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

Author Topic: How to sort a custom view scheme in a non-alphabetic fashion?  (Read 3109 times)

BacHolz

  • Recent member
  • *
  • Posts: 9
How to sort a custom view scheme in a non-alphabetic fashion?
« on: September 23, 2014, 03:27:31 pm »

Using MC 20, I would like to create a view scheme wherein the genres are sorted chronologically and appear as Medieval, Renaissance, Baroque, Classical and so on. Presently the view depicts the genres alphabetically. How can I create a “view” which will present these chronologically?

Years ago when I maintained an Access database to catalog my music, I created a numeric variable for each genre and sorted on this field to manage the sort order. Is that the way to go here or is something simpler and better possible? Not a critical concern to be sure just an obsessive itch to get things “just right” – something I think many of you can relate to.

Many thanks for any suggestions forthcoming.
Logged

leezer3

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1588
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #1 on: September 23, 2014, 03:33:34 pm »

Yep, that's essentially what you want. Set your custom field to be a calculated field with a numeric return value, and it'll do all the work for you :) This is my sort field to keep data for video shoots with associated text and images:
Code: [Select]
ifelse(isequal([media type],Video),1,isequal([media type],Data),2,isequal([media type],Image),3)
Should be very simple to understand, but basically just set the isequal to key off Genre, and then use Medieval as 1 and so-on in chronological order. MC will automatically calculate the value for this field rather than it needing to be entered manually.

Then set the viewscheme to sort on this and you're good to go. I normally use a field name starting with zzz to distinguish these and keep them at the end of any list.
You can also use multiple fields to sort by.

-Leezer-
Logged

AndyU

  • Galactic Citizen
  • ****
  • Posts: 363
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #2 on: September 23, 2014, 03:41:58 pm »

Add a tag - call it say GenreSort. (There are already ComposerSort and ArtistSort tags, though not all rippers rip them, nor do all cds have them).

Then you need to populate it. You can either do this manually; use the wizard to find all tracks with a particular Genre, highlight them and click into the tag editor to set the GenreSort to the value you want. You only need to do this once per Genre, so it's not that much work. Or you can be a bit smarter and make your GenreSort tag a expression tag and use a bit of MC programming to set it .. along the lines of IF(IsEqual([Genre],Baroque),01,If(IsEqual([Genre],Early),02, .........)))))

However you set it up you can then use this tag to sort with in the view you want.

Edited to add: Looks like I was typing my post while the previous one beat me to it .. must mean we are definitely giving good advice!
Logged

BacHolz

  • Recent member
  • *
  • Posts: 9
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #3 on: September 23, 2014, 05:49:14 pm »

Thank you both for your prompt responses. I'm not yet at home where I can go into this further.

Where I'm at now is I searched for a field that was unpopulated and not in use. Grouping presented itself and I opened the Medieval genre, selected all files and set "Grouping" to "1".

So far so good, however when I attempt to sort on "Grouping", I find the variable to be unavailable for selection.

I'll be home soon and can explore this further. When I mentioned that I created a database for my classical collection, I should add that this was years ago for a introductory class project. To clarify, I am not proficient in db management and am still unfamiliar with JRiver expression language. Your patience and understanding will be needed and much appreciated.
Logged

AndyU

  • Galactic Citizen
  • ****
  • Posts: 363
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #4 on: September 24, 2014, 02:46:09 am »

Hi BacHolz - you're definitely on the way. Using the Grouping tag and setting it manually is a perfectly reasonable way to go.

To use the Grouping field to sort your Genre view:

Get your CustomGenre view on the screen.

Next to CustomGenre at the top of the main view pane, there is a drop down. Click it and you will have a Sortby option. Click that and you get a list of candidate fields. Grouping isn't there, but at the bottom there is an option marked "Custom". Click that and you get another pop up window with "Name (a-z)" in it. Click Remove to get rid of that. Click Add, then Click A-Z then you get a list of all possible tags. Grouping will be one of them. Click it and you're done.

Just a wee note - if you have any more than 10 genres of your own, you'll probably need to use something other than 1..2 ..3  because if you do, when you get to 11 it may get treated as alphabetical and so sort between 1 and 2. Use something like 001, 002 ... or A1, A2, ... B1.. B2  ..

Logged

BacHolz

  • Recent member
  • *
  • Posts: 9
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #5 on: September 24, 2014, 01:15:55 pm »

Thanks to all the support so far. I'm back at my desk now, so as I explained, I’ve made some progress but am still stuck with this task. Within my Genre view scheme, I would like to have the genres displayed chronologically. I used the unpopulated “Grouping” field as a numeric field wherein Medieval = 1, Renaissance = 2, Baroque = 3 and so forth. In this way I thought to sort the genres on this field and the view would then display the genres in a generally chronological order.  Medieval, Renaissance, Baroque, Classical etc…
Prior to AndyU's thoughtful advice, I discovered how to add a non-standard sort variable

And this was my result, closer but predictably, it appears as 1,2,3 etc.

No real surprise here it does what I asked, but my hope is to use the "Grouping" field to sort but display the groups by their Genre name - Medieval - Renaissance - Baroque - Classical, etc.
So how to accomplish this last refinement?

I was earlier advised by leezer3 (thanks again) to create a calculated field using this example as a model.

ifelse(isequal([media type],Video),1,isequal([media type],Data),2,isequal([media type],Image),3)

For my purposes, I modified this example to

ifelse(isequal([Genre],Medieval),1,isequal([Genre],Renaissance),2,isequal([Genre],Baroque),3,isequal([Genre],Classical),4,isequal([Genre],Romantic),5,isequal([Genre],Opera & Ballet),6,isequal([Genre],Post Romantic),7,isequal([Genre],Twentieth Century),8,isequal([Genre],Trans Genre),9)

Hopefully I've made no syntactic errors, but I don’t know how and where to employ it as an expression.
Any last guidance to accomplish this challenge will be much appreciated. First attempt at an image attachment, not sure if I succeeded or not!
Attempted to correct image attachment, seems straight forward, but I've had no luck yet. My apologies as pictures would be helpful to those kind enough to offer direction.
Successful image posting on last effort!
Logged

connersw

  • Citizen of the Universe
  • *****
  • Posts: 661
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #6 on: September 24, 2014, 02:13:59 pm »

Under Show Categories In This Order, click on Groupings -> Edit.  Instead of using the Library Field Groupings, change the radio button to an Expression. 

Expression to group by: [Groupings]
Expression to display: [Genre]
Logged

AndyU

  • Galactic Citizen
  • ****
  • Posts: 363
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #7 on: September 24, 2014, 02:33:56 pm »

BacHolz - you are getting in way too deep and overcomplicated.

As I understand it, you want to have a view of Genres, but in an order defined by a tag called "Grouping".

If that is correct drop the "Grouping" tag from your view. It just wants to be Genre/Style/Composer/Conductor/Albbu.

It will now give you Genres x Style x Composer x Conductor, but the Genres will display in alphabetical order, not Grouping order.

Now do what I said in my previous post! ie tell MC the Sort Order of the Genre group is by Grouping (A-Z)!

You can do it the way I said, or you can set the sort order as you discovered in the "Modify results" bit, but in the "Modify Results" for Genre.

Trust me. No expressions, no malarkey.

Logged

BacHolz

  • Recent member
  • *
  • Posts: 9
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #8 on: September 24, 2014, 03:41:13 pm »

Thanks for your patience and suggestions. Trying simplicity first, when I try to follow AndyU's advice I removed grouping from the view as directed, (leaving only genre, style, composer, conductor) and then try to sort from the top menu

Seems like it makes sense, but I get this again

Love to keep it simple, but maybe I'm too simple cause I'm still stuck. Wish I could respond more quickly but I'm not yet facile with posting images, etc. Patience appreciated...
Logged

AndyU

  • Galactic Citizen
  • ****
  • Posts: 363
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #9 on: September 24, 2014, 03:46:29 pm »

OK you are nearly there. Just get rid of the Name (A-Z) entry at the top of the Custom Sort by box. It should just have Grouping (A-Z) in it.

You're there.

(Name in this context stands for whatever the the level is -ie it means Genre in your example, so by having Name (a-z) you  have just asked it to sort by Genre .. which is what it did.)

Isn't the Jerusalem Quartet/Mozart CD wonderful?! I have their Haydn too .. superb.

PS. As I said before, watch out if you have more than 9 Groupings and have just used numbers 1,2, ...10,11, 12.. .. 10, 11 etc may come between 1 and 2
Logged

BacHolz

  • Recent member
  • *
  • Posts: 9
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #10 on: September 24, 2014, 04:18:35 pm »

Thanks so much, success at hand...



The devil is in the details and the details can be devilish.

Special thanks to AndyU and all those who share their experience freely with us all. The Jerusalem Quartet/Mozart CD is a great find, something from the early, middle and mature Mozart.
Their Schumann Piano Quartet and Quintet release with Alexander Melnikov is enjoyable as well.
As it turns out I have only 9 genres so no sorting problems present themselves.

Further refinements to follow as I think I've caught a bug of sorts. Owned MC since 16 and only now trying to tap into the abilities to manage and display my library in so many useful ways.

Thanks to all.
Logged

AndyU

  • Galactic Citizen
  • ****
  • Posts: 363
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #11 on: September 24, 2014, 04:27:12 pm »

Well done! My advice, fwiw, is to go slowly, a small step at a time. If you've got a view working, but want to take it further, make a copy of it and play with the copy, trying each step out. If you mess up, you've always got your original view to go back to.
Logged

BacHolz

  • Recent member
  • *
  • Posts: 9
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #12 on: September 24, 2014, 04:36:52 pm »

Excellent advice which I learned the hard way.
I had something going well with a custom view and pulled it too far without a saved copy.
Not really a loss but rather a lesson learned!
I can see me spending a lot of time and effort exploring this phenomenal program.
Again thanks for your patient guidance. Happy listening...
Logged

leezer3

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1588
Re: How to sort a custom view scheme in a non-alphabetic fashion?
« Reply #13 on: September 25, 2014, 05:02:18 pm »

Glad to see you're getting somewhere, but please post back if you need any more help :)

A couple of small notes-
You'll find that you probably want your sort by box to contain these values in this order:
Grouping (A-Z)
Album (A-Z)
Track # (A-Z)
Name (A-Z)
Filename (A-Z)

This is because MC will sort by each of these in order. If you only have Grouping (A-Z), then it'll sort by grouping, and then fall back to the default sorting within the groupings, which IIRC is Name first, and may produce some slightly odd looking results; Is this the 'bug' you've found? :P

Secondly-
It's never advisable to store a calculated field in a default tag, or to modify the data type of default tags.
If you do this, they may very occasionally get reset to default if the database version is upgraded, which may potentially cause loss of data you've entered in extreme cases. (Normally, it'd just require the data/ edit type to be reset, but that's inconvenient)

-Leezer-
Logged
Pages: [1]   Go Up