what is (ifelse)
It's an MC Expression function -->
Click for more infoI know the expression below is currently wrong (because it won't work), but I'm wondering what I need to do to make it right. I've tried a few things to no avail...
I have a smartlist full of my favorite tracks. I've determined the playlistid for this is 48710862. Now, how do I apply that info to the code here correctly?
ifelse(isequal([playlistid==48710862]), Favorite Tracks, 1, Not Favorite Tracks)
Unfortunately, the expression engine will not work with playlist ids. We've asked on and off over the years, but nothing yet.
Could you come at it from the other end, perhaps? Let's find out...
What are the criteria for a files' inclusion in your smartlist? i.e., what makes a favourite, a favourite?
You could create a new, expression based library field called "Favourite Tracks" without the quotes, and then set the rule for the field so that if the file matches the rule set, MC will populate the field with either "Favourite Tracks" or "Not Favourite Tracks", and it would keep on doing this for you automagically as you add tracks.
Then you would have the library field [Favourite Tracks] available to you for use anywhere you liked within the program.
Let us know if you need any assistance with this....
-marko
EDIT:
Also, just in case you were wondering, other than the fact that it will never work, there's nothing else wrong with your expression format, other than perhaps a bit overkill for what you want.
Let's just say, for the sake of example, that the only rule for your smartlist is that [Rating] is greater than or equal to 4.
When you create your new library field, both of these will work:
ifelse(isequal([Rating],4,6), Favorite Tracks, 1, Not Favorite Tracks)
or
if(isequal([Rating],4,6), Favorite Tracks, Not Favorite Tracks)
"ifelse()" comes into its own when you want to nest a lot of "if()" statements. I had one with well over 40 "if()"s, and at the end, these all need to be closed off with 40 closing parenthesis, you know, like )))))))))))))))))))))))))))))))) and so on. With the "ifelse()" and the "!" mark to flip the result if required, all of that can be placed in a single "ifelse()" wrapper making everything a lot easier to follow.
The "6" in the two expressions above instruct the evaluator to compare for "greater than or equal to"
-marko