INTERACT FORUM

Please login or register.

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

Author Topic: Please add Global Variable usage in the Add Rules section of Smartlists  (Read 89 times)

rbmjr

  • World Citizen
  • ***
  • Posts: 109

I thought that I could use a global variable in the Add Rules section, however it seems that global variables only work in the Modify Results section (see attachment). Could you please add Global Variable usage in the Add Rules section?
Logged

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1853

You need to use the Custom rule in the Add Rules section and build your own test that way.

Custom: [=compare([last played],>,load(gvRandom)]]=1

Or something like that.  It quite often helps to add an expression column to your view and work on this expression there until you have it right, and then move it into the smartlist rules, otherwise you spend a lot of time fiddling with that dialogue while you work through the code.

The stuff in the [] is your test - the =1 outside is the smartlist test for positivity, ie if your rule is true and the result should be included.
Logged

rbmjr

  • World Citizen
  • ***
  • Posts: 109

Thanks, I'll give that a try. I always wondered what the []=1 was for
Logged

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2397

The syntax for the left side is [=expression]; this expression can return any value which you then compare using the normal Smartlist operators. So for an expression that returns 0 or 1, you may do [=expression]=1, but for other cases you may want [=expression]="English","United States" or [=expression]=>3 for instance.
Logged
Pages: [1]   Go Up