INTERACT FORUM

Please login or register.

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

Author Topic: Smartlist generator question  (Read 2307 times)

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Smartlist generator question
« on: September 12, 2008, 11:31:14 pm »

I had a playlist called Incorrect Rating that would show me where [Rating] != [Ben's Rating].  That doesn't work so I had to elaborate with all the options: R =1 & B != 1, etc... so 10 total comparisons.  When I opened to edit it and only added a SORT item, it stopped working.  Now I can't get it to function at all.

Is there a way to make [Rating] != [Ben's Rating] work??  Seems so simple in SQL!
Logged

ProblemChild

  • Junior Woodchuck
  • **
  • Posts: 97
  • But I don't wanna be the same as everybody else...
Re: Smartlist generator question
« Reply #1 on: September 13, 2008, 09:14:20 am »

I had a similar question recently solved by Marco. I think it's what you're looking for...

[=isequal([Rating],[Ben's Rating],1)]=0

Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Smartlist generator question
« Reply #2 on: September 13, 2008, 09:53:05 am »

I had a similar question recently solved by Marco. I think it's what you're looking for...

[=isequal([Rating],[Ben's Rating],1)]=0
I have zero experience with SQL, but I'm guessing that "!=" is SQL speak for "is not equal to"

[=isequal([Rating],[Ben's Rating],1)]=0 might be more reliable if you use a numeric compare for equality, rather than a case-insensitive string compare...

[=isequal([Rating],[Ben's Rating],2)]=0

A full list of isequal compare types can be found in the wiki, here. I see that page I created has just shy of 6000 views so far... hopefully some of those 6000 have found the information helpful.

-marko.

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Smartlist generator question
« Reply #3 on: September 13, 2008, 04:47:52 pm »

Quote
hopefully some of those 6000 have found the information helpful.

probably not.

JUST KIDDING, lol.  That's pretty good!
Logged

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Smartlist generator question
« Reply #4 on: September 13, 2008, 05:13:00 pm »

This is so close to exactly what I need.  The problem is that using those, items that haven't been set yet, [Ben's Rating] = [] and [Rating] = ?, they don't line up as identical.  So null is not equal to ?, which is the Rating's null value.  How can I force convert these two items to integers?  Is there an int or integer function?  Could probably be placed right in the isequal function for simplicity.

I can make it work with a bunch of extra junk comparing rating & ben's rating but it gets hectic.  Any other solutions to this problem welcome!
Logged

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Smartlist generator question
« Reply #5 on: September 15, 2008, 04:47:54 pm »

Simply taking what was said above, which almost works, and adding this would probably work:

-[Rating] = ? OR -[Ben's Rating] = 0

How can the above be converted to working MC query code?

How can I make this work as expected?  The problem is that 0 is not equal to ?.  Rating defaults to ? and [Ben's Rating] defaults to 0 (integer).  So comparing direct equality would work except for this.  So the thinking is that if AT LEAST one of the two fields are essentially = 0 (aka ?), then it would eliminate the cases where they both equal their zero value.

If Rating = ? & Ben's Rating = 0, without this, the items would be returned (bad).

Now apply the above constraint... [RATING] != ? OR [BEN'S RATING] != 0 ... it would fail because [Rating] = ? (not !=) and [Ben's Rating] = 0 (not !=).

XOR (exclusive or) would break it a bit because then it wouldn't return changed values.  It would show initially rated songs [Rating]=5 & [Ben's Rating]=0...but if I updated Ben's Rating, and then changed Rating, it wouldn't bring it up...
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Smartlist generator question
« Reply #6 on: September 16, 2008, 01:45:11 am »

I'm finding it really hard to follow what you're doing, but, when using expressions, to get the same list as: [rating]=[], you have to use isequal([rating],? stars)
Simply taking what was said above, which almost works, and adding this would probably work:

-[Rating] = ? OR -[Ben's Rating] = 0

How can the above be converted to working MC query code?
(-r=[] or -[Ben's Rating]=0)

You could change all the values for [ben's rating]=0 to ? stars and that should cause them to behave as expected with the original expression based query?

-marko
Pages: [1]   Go Up