INTERACT FORUM

Please login or register.

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

Author Topic: Smartlist syntax - AND/OR  (Read 1894 times)

strebormj

  • Recent member
  • *
  • Posts: 42
Smartlist syntax - AND/OR
« on: February 07, 2009, 08:58:17 am »

I have tracks with myriad Genre values like "Alt Rock," "Alternative Rock," "New Rock," "Nu Rock," etc., that I would like to include in a smartlist.   There doesn't seem to be a way to OR together values of a [Genre] [Contains] rule, and there doesn't appear to be a guide on how to use a contains-type function in a [Custom] rule. 

What's the best way to implement < Genre.Contains("rock") || Genre.Contains("alt") >?

Thanks
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: Smartlist syntax - AND/OR
« Reply #1 on: February 07, 2009, 09:14:42 am »

Logged

strebormj

  • Recent member
  • *
  • Posts: 42
Re: Smartlist syntax - AND/OR
« Reply #2 on: February 07, 2009, 12:24:06 pm »

([Genre]="alt" or [Genre]="rock")

??

http://yabb.jriver.com/interact/index.php?topic=46456.msg318347#msg318347

Mark


Your example matches complete strings, not substrings, correct?  I'm looking to match substrings, which means either using wildcards or contains() I think.

Thanks for the link to the page on grouping rules, however. 
Logged

strebormj

  • Recent member
  • *
  • Posts: 42
Re: Smartlist syntax - AND/OR
« Reply #3 on: February 07, 2009, 12:41:03 pm »

It looks like

Custom (
Genre contains "alt"
Genre contains "rock"
Custom )


might be the way to do it, although after doing that, the dialog seems to screw up the paren and bracket symbols.  Doing what I did above results in the grouping being lost and the logic being switched to (Genre.Contains("rock") AND Genre.Contains("alt")).

Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: Smartlist syntax - AND/OR
« Reply #4 on: February 07, 2009, 01:12:27 pm »

My example should match substrings... 

Mark
Logged

strebormj

  • Recent member
  • *
  • Posts: 42
Re: Smartlist syntax - AND/OR
« Reply #5 on: February 07, 2009, 01:44:35 pm »

My example should match substrings... 

Mark


Hmm.  That does work.  When I close the dialog and reopen it, it creates the grouping correctly.


Thanks for the tip.

Do you know how to handle negation (e.g., ([Genre]="alt" or [Genre]="rock" AND [Genre]<>"classic")?  Apparently it's not "!=" or "<>" or "!([Genre]=...").
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: Smartlist syntax - AND/OR
« Reply #6 on: February 07, 2009, 04:26:35 pm »

To negate, put a - in front of the expression, eg

-[genre]="rock"

will show all genres that do not contain "rock"

Mark
Logged

strebormj

  • Recent member
  • *
  • Posts: 42
Re: Smartlist syntax - AND/OR
« Reply #7 on: February 07, 2009, 05:27:23 pm »

Thanks again, Mark.
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: Smartlist syntax - AND/OR
« Reply #8 on: February 08, 2009, 02:50:53 am »

You should try using the Wizard to create expressions, it's much easier to begin with.  You can then see the text version by clicking on import/export in the wizard.

To access the wizard in the search field, click the down arrow.

Cheers,

Mark
Logged
Pages: [1]   Go Up