INTERACT FORUM

Please login or register.

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

Author Topic: How to test if a field value is one of 3 specific values?  (Read 1984 times)

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
How to test if a field value is one of 3 specific values?
« on: June 24, 2016, 05:07:25 am »

I have the custom field, Original Language, with possible values: fr, en, ja, ko, pl, zh, ...
How can I test if its value for a given movie is ja, ko or zh (ie is any of these 3 values)?
I want a custom expression that separates the movies with ja, ko or zh as value from all the others.
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: How to test if a field value is one of 3 specific values?
« Reply #1 on: June 24, 2016, 05:10:55 am »

Well, I found this way:
Code: [Select]
isequal(jakozh, [Original Language], 8)
Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: How to test if a field value is one of 3 specific values?
« Reply #2 on: June 24, 2016, 05:56:47 am »

That will work but will also match if the [Original Language] is "ak" or "oz".

Take a look at the IfElse command. That can be more specific.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: How to test if a field value is one of 3 specific values?
« Reply #3 on: June 24, 2016, 06:32:28 am »

Regex was designed for these types of tests:

http://wiki.jriver.com/index.php/String_Manipulation_Functions#Regex

This is untested, but something like:

regex([Original Language],/#ja|ko|zh#/)

That should give a 1 for true and a 0 for false.

Brian.
Logged
Pages: [1]   Go Up