INTERACT FORUM

Please login or register.

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

Author Topic: Field Expresssion  (Read 2473 times)

stevenf

  • Regular Member
  • World Citizen
  • ***
  • Posts: 209
  • It works for me....
Field Expresssion
« on: September 13, 2006, 10:55:58 am »

I wonder if anyone knows where to find on the web a guide to expressions that are put into the Calculated data section of the field.

For instance, in the NumberPlays Fiield, it currently looks like this

1
2
3
3....
1000

What i want is to create a new field using the numberPlays field and getting this.

00001
00002
00003... and so on.

Thanks

Stevenf
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9124
Re: Field Expresssion
« Reply #1 on: September 13, 2006, 02:35:50 pm »

stevenf

  • Regular Member
  • World Citizen
  • ***
  • Posts: 209
  • It works for me....
Re: Field Expresssion
« Reply #2 on: September 14, 2006, 12:28:43 am »

I've checked the link, but can't for the life of me understand it, do you know of anything easier? Or that gives easy to understand examples of how it's done.

Thanks

Stevenf
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9124
Re: Field Expresssion
« Reply #3 on: September 14, 2006, 02:31:54 am »

if(isequal([number plays],10,3),000[number plays],if(isequal([number plays],100,3),00[number plays],if(isequal([number plays],1000,3)0[number plays],[number plays])))

untested, but should work as requested in your opening post.

you ask an if() question, then tell MC what to do if the answer is yes, and what to do if the answer is no. In each case above, if the answer is no, we ask another question, right up to the point where [number plays] is not less than 1000, in which case, we stop asking questions, tell MC to just use the [number plays] value, and close the expression.

if(isequal([number plays],10,3),
This says, "if [number plays] is less than 10" and is immediately followed by the instructions to carry out if the answers is yes, the instructions that follow the next comma, in this case, we ask another question, tell MC what to do if the answer is no.

It's wierd, I can follow these things quite well, but glynor caused my eyes to glaze over with his recent windows scripting host posts!!!

-marko.

stevenf

  • Regular Member
  • World Citizen
  • ***
  • Posts: 209
  • It works for me....
Re: Field Expresssion
« Reply #4 on: September 14, 2006, 03:45:40 am »

The Expression sort of works, exept for 3 points.

First, i want the number plays to look like this.

001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011.. and so on, right down to...

100, 101, 102, 103 and so on.

What the expression looks like is this. 000, 0001, 0002, 0003, 0004...and so on.

The second problem is i have one file that has been played over 100 times and that field is empty. and the third if a file has not been played, then i want the field kept empty. If you could help me with this, i'd be very grateful.

Stevenf
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9124
Re: Field Expresssion
« Reply #5 on: September 14, 2006, 05:13:00 am »

spot the difference:
What i want is to create a new field using the numberPlays field and getting this.

00001
00002
00003... and so on.
--------
First, i want the number plays to look like this.

001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011.. and so on, right down to...

100, 101, 102, 103 and so on.

What the expression looks like is this. 000, 0001, 0002, 0003, 0004...and so on.

The second problem is i have one file that has been played over 100 times and that field is empty. If you could help me with this, i'd be very grateful.

Stevenf
:)

I typed too quickly the first time and missed out a vital comma :-[

As I'm not 100% clear what it is you're after...

this correctly outputs to 4 figures:

if(isempty([number plays]),0000,if(isequal([number plays],10,3),000[number plays],if(isequal([number plays],100,3),00[number plays],if(isequal([number plays],1000,3),0[number plays],[number plays]))))

and this does 3:

if(isempty([number plays]),000,if(isequal([number plays],10,3),00[number plays],if(isequal([number plays],100,3),0[number plays],[number plays])))

If you use them in panes, and have sorting issues, add the following to the end, immediately after the last bracket without any spaces:

&DataType=[number]

-marko.

stevenf

  • Regular Member
  • World Citizen
  • ***
  • Posts: 209
  • It works for me....
Re: Field Expresssion
« Reply #6 on: September 15, 2006, 08:30:23 am »

Marko

Just tried the expression and it worked perfectly, in fact both did. Thanks for all your help, it's much appreciated, also, i notice that you are a member of the Version 12 Testing team, one quick question about the new version, has the save all views setting been returned in the Customize Views?

Stevens
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9124
Re: Field Expresssion
« Reply #7 on: September 15, 2006, 10:38:38 am »

Glad you're off and running now. good stuff...

re. v12...
jimh has hinted that a v12 build should be available soon.
Pages: [1]   Go Up