INTERACT FORUM

Please login or register.

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

Author Topic: Does Calculated fields support IF...THEN...ELSE?  (Read 2724 times)

221bBS

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 703
Does Calculated fields support IF...THEN...ELSE?
« on: June 29, 2003, 04:14:03 pm »

I was wondering if the calculated fields support IF/THEN/ELSE?

Let me try to explain...

I have 2 fields:

Song Title
Song Title Version

The Song Title field is always filled but the Song Title Version is only used sometimes. I want the calculated field to use the following template if there is no Song Title Version:

[Song Title]

If there is a Song Title Version I want it to use the following template:

[Song Title] [[Song Title Version]]

So I want the following:

IF Song Title Version is not empty THEN [Song Title]  [[Song Title Version]] ELSE [Song Title]

Examples:

Song 1

Song Title=Time After Time
Song Title Version is blank

This would look like this

Time After Time

Song 2

Song Title=Time After Time
Song Title Version=Rave Mix

This would look like this

Time After Time [Rave Mix]

Currently I can only seem to get the songs like this:

Song 1
Time After Time []

Song 2
Time After Time [Rave Mix]

Is it possible?
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: Does Calculated fields support IF...THEN...ELS
« Reply #1 on: June 29, 2003, 04:59:13 pm »

Why not include the "[]" in the Song Title Version and then just use [NAME] [SONGTITLEVERSION] as your calculated field?

Or if you want to have Song Title Version without the "[]" and then the calculated field have the "[]" then create 3 fields.

SongTitleVersion
SongTitleVersionCalc
Temp

Make Temp a calculated field of "[SongTitleVersion]". This should automatically fill Temp with the values of SongTitleVersion with [] around it.

Use the Copy Fields tool to copy the value of Temp into SongTitleVersionCalc for only those files that have a SongTitleVersion. You can easily use the sort function to filter out the ones that don't really have anything. Now you should have 2 fields. One with just the Song Title Version without [] to display as a column, and one with the [] to be used in your calculated field along with the Title. Temp was only used because it was easy to create the [Song Title Version] format you're after, without being left with a bunch of files with [] listed in them. You can delete the Temp field now.

Then make your calculated field so that it's "[NAME] [SONGTITLEVERSIONCALC]".

This should give you what you want... if I'm following my own logic right. It's hardly an automated thing, but it should at least get you caught up, and then you can just keep things up to date the way you want as you add new files.
Logged

221bBS

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 703
Re: Does Calculated fields support IF...THEN...ELS
« Reply #2 on: June 29, 2003, 06:43:36 pm »

First of all.. THANKS again Doof for your help...your advice has for the second time helped me today.

I was planning on using the Name field for the song title...don't know why I just didn't use it in the post ::)

Next time I will try to be more clear in my posts ;D

Back to the subject...I guess the best option right now is:

Quote
Why not include the "[]" in the Song Title Version and then just use [NAME] [SONGTITLEVERSION] as your calculated field?


But I was hoping that MC could automatically filter out the unwanted " []" when needed...maybe in the future this will be possible ;D
Logged

Doof

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5908
  • Farm Animal Stupid
Re: Does Calculated fields support IF...THEN...ELS
« Reply #3 on: June 29, 2003, 07:41:17 pm »

Not sure if we're understanding each other, but to clarify using the example you provided earlier...

If you have:

Name : Time After Time
Song Title Version : Ultramix

and you want:

Name With Version : Time After Time [Ultramix]

then you could just be sure that you had:

Name : Time After Time
Song Title Version : [Ultramix]

instead. And just obviously leave Song Title Version blank for those that don't have one.

Then when you set Name With Version to [NAME] [SONGTITLEVERSION] you'd get:

Time After Time [Ultramix] for that file and just Time After Time for a file that didn't have anything in Song Title Version.

But again... I'm not sure if we're talking the same thing or not. I think we are, but I wanted to be sure.

My other idea was in case you didn't want the values stored in Song Title Version to have the [] around them. That way you would store that value twice. Once with the [] and once without, and then just use the one you wanted for the situation you wanted.
Logged

221bBS

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 703
Re: Does Calculated fields support IF...THEN...ELS
« Reply #4 on: June 29, 2003, 09:07:46 pm »

You got the idea...
Quote
Not sure if we're understanding each other, but to clarify using the example you provided earlier...

If you have:

Name : Time After Time
Song Title Version : Ultramix

and you want:

Name With Version : Time After Time [Ultramix]

then you could just be sure that you had:

Name : Time After Time
Song Title Version : [Ultramix]

instead. And just obviously leave Song Title Version blank for those that don't have one.

Then when you set Name With Version to [NAME] [SONGTITLEVERSION] you'd get:

Time After Time [Ultramix] for that file and just Time After Time for a file that didn't have anything in Song Title Version.

This idea is the one I am most likely to use and the other
Quote
My other idea was in case you didn't want the values stored in Song Title Version to have the [] around them. That way you would store that value twice. Once with the [] and once without, and then just use the one you wanted for the situation you wanted.

This idea is closer to what I really want but seems like it would be more work for me to keep things synced. But on second thought...I could sync the two easily enough ever so often.

I think I'll sit on this for a few days...Thanks again
Logged

221bBS

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 703
Re: Does Calculated fields support IF...THEN...ELS
« Reply #5 on: July 09, 2003, 12:41:56 pm »

;D OMG ;D

Just wanna Tell MC
THANK YOU

I was finally ready to do the following:
Quote
Or if you want to have Song Title Version without the "[]" and then the calculated field have the "[]" then create 3 fields.

SongTitleVersion
SongTitleVersionCalc
Temp

Make Temp a calculated field of "[SongTitleVersion]". This should automatically fill Temp with the values of SongTitleVersion with [] around it.

Use the Copy Fields tool to copy the value of Temp into SongTitleVersionCalc for only those files that have a SongTitleVersion. You can easily use the sort function to filter out the ones that don't really have anything. Now you should have 2 fields. One with just the Song Title Version without [] to display as a column, and one with the [] to be used in your calculated field along with the Title. Temp was only used because it was easy to create the [Song Title Version] format you're after, without being left with a bunch of files with [] listed in them. You can delete the Temp field now.

Then make your calculated field so that it's "[NAME] [SONGTITLEVERSIONCALC]".

This should give you what you want... if I'm following my own logic right. It's hardly an automated thing, but it should at least get you caught up, and then you can just keep things up to date the way you want as you add new files.


I made my calculated field and was ready to filter out all the " []" out but I couldn't find it. I added my newly created "Name (Version) Calc" field to the "Visable Columns" and it was blank until I scrolled down to the bottom. At thew bottom was all the version info in brackets.

MC does not show the info if the field that is to be calculated is empty...Just what I wanted ;D
Logged

221bBS

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 703
Re: Does Calculated fields support IF...THEN...ELS
« Reply #6 on: July 09, 2003, 12:48:21 pm »

All I need to do is create 2 fields now to do what I want.

Default:
[Name] - Already have

Custom fields:
[Name (Version)] - For the version of the song
[Name (Full)] - Calculated field. Template: [Name] [[Name (Version)]]
Logged
Pages: [1]   Go Up