Our Preferred 5 Star Hosting Provider - Award Wining FileMaker Pro Hosting
Results 1 to 4 of 4

Thread: Condition List

  1. #1
    Preferred Member
    Join Date
    Aug 2005
    Posts
    600
    Downloads
    0
    Uploads
    0

    Condition List

    I have a found set where records show a cost value, tableA::Cost. and a color, tableA::Color.

    I need a calculation for a script that list the Cost for all records where color = red. Example 2, 3, 5, 6, 8

    My thought is to set a variable of each list as I need for color = red, blue and green

    thanks,
    Jim
    Warning: This is an Old Thread
    This discussion is older than 420 days. information contained in it may no longer be current

  2. #2
    Senior Moderator - FMT Preferred Developer Consultant - West Coast USA - Global Techphan's Avatar
    Join Date
    Mar 2006
    Posts
    2,264
    Location
    Southern California
    FileMaker Version
    FM 9 Server, FM 10 Server, FM 11, FM 11 Server
    OS
    Windows & Mac
    Skill Level
    Intermediate
    Downloads
    0
    Uploads
    0

    Re: Condition List

    Make a table where all colors and their corresponding costs are contained.

    Example
    Red...2
    Red...4
    Red...5
    Blue..3
    Blue..5
    etc.


    Create a new global field called "Color." Make a value list from the table and use the global field for the "Include only related values..." setup step. Use a script trigger "On Object Modify" such that when the color is chosen, the global color field is set with the chosen color.
    For more information on "Conditional Value Lists" go to the 2nd post of this thread.

  3. #3
    Preferred Member
    Join Date
    Aug 2005
    Posts
    600
    Downloads
    0
    Uploads
    0

    Re: Condition List

    I tried a script that looks like this:
    Go to Record/Request/page [first]
    Loop
    If (TableA::Color=Red)
    Set Variable [$Red ; value: $Red & TableA::Cost & ","]
    ElseIf (TableA::Color=Blue)
    Set Variable [$Blue ; value: $Blue & TableA::Cost & ","]
    ElseIf (TableA::Color=Green)
    Set Variable [$Green ; value: $Green & TableA::Cost & ","]
    Go to Record/Request/Page [next ; exit after last]
    End Loop
    Set Field [$Red ; value: Left ( $List ; Length ( $List ) -1 ) //strip off the extra comma]
    Set Field [$Green ; value: Left ( $List ; Length ( $List ) -1 ) //strip off the extra comma]
    Set Field [$Blue ; value: Left ( $List ; Length ( $List ) -1 ) //strip off the extra comma]

  4. #4
    Senior Moderator - FMT Preferred Developer Consultant - West Coast USA - Global Techphan's Avatar
    Join Date
    Mar 2006
    Posts
    2,264
    Location
    Southern California
    FileMaker Version
    FM 9 Server, FM 10 Server, FM 11, FM 11 Server
    OS
    Windows & Mac
    Skill Level
    Intermediate
    Downloads
    0
    Uploads
    0

    Re: Condition List

    So you do NOT need a value list (my error there), but a script that gives you a final list after the script is run?

    Edit: Instead of using this command line in the script -->Set Variable [$Red ; value: $Red & TableA::Cost & ","]

    why not use ---> Set Variable [$Red ; value: $Red & & TableA::Cost]
    ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. put a button in IF condition
    By fmruser in forum FileMaker Pro 9
    Replies: 6
    Last Post: 02-05-2009, 02:44 PM
  2. Value list with calc or condition?
    By Hawaii80 in forum Value Lists
    Replies: 13
    Last Post: 04-27-2008, 03:41 PM
  3. Conditional Value List with hidden condition?
    By joraff in forum FileMaker Pro 7.0
    Replies: 3
    Last Post: 06-28-2007, 01:26 PM
  4. Summary with condition
    By palba in forum FileMaker Pro 7.0
    Replies: 5
    Last Post: 07-04-2006, 12:46 AM
  5. sum by condition
    By axis3 in forum FileMaker Pro 7.0
    Replies: 3
    Last Post: 09-10-2005, 04:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Welcome to the Original FileMaker Forum
With designated forums for almost every FileMaker topic...FileMaker Today is a free-to-join community where you can boost your FileMaker expertise, build better solutions and solve your technical challenges. If you're building FileMaker solutions, this is the place for you.
Follow FMT
We Are FMT
FMT is home of The World's leading FileMaker News Site, Worldwide Developer Directory, FileMaker Connect Community and so much more.