Alpha Video Training
Results 1 to 5 of 5

Thread: Lowest of three fields

  1. #1
    Member
    Real Name
    John Wilson
    Join Date
    Aug 2006
    Location
    Lichfield, Staffordshire; UK
    Posts
    119

    Default Lowest of three fields

    Hi ... a little help please. In a report I want to display the data from the lowest of three fields. e.g.:

    Field A = 131
    Field B = 130
    Field C = 127

    I want to display the value of Field C i.e. 127

    Do I use a Calculated field and if so what would be the expression or is the a better/easier solution?

    Thanks
    John

    Currently Using Alpha ver 12.4.4.4. Build: 4346; Addins: 4889 against MySql databases

    Church Job Finder
    A Church of England Enabling Recruitment Partner "Right People, Right Place, Right Time"

  2. #2
    Member
    Real Name
    Allen Klimeck
    Join Date
    Apr 2000
    Location
    Colorado
    Posts
    535

    Default Re: Lowest of three fields

    CalculatedField = *min(FieldA.value+crlf()+FieldB.value+crlf()+FieldC.value)

  3. #3
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,257

    Default Re: Lowest of three fields

    could do calcField = case(a<b,min(a,c),b<a,min(b,c))

  4. #4
    Member
    Real Name
    John Wilson
    Join Date
    Aug 2006
    Location
    Lichfield, Staffordshire; UK
    Posts
    119

    Default Re: Lowest of three fields

    Thanks for the help guys both worked ....

    Allen ... It took me a moment to realise that as the field are are already numeric I didn't need the .value

    Greg .... your suggestion calcField = case(a<b,min(a,c),b<a,min(b,c)) works for three fields.

    I have not use "case" before so if there are four fields would it be calcField = case(a<b,min(a,c),b<a,min(b,c),c<a,min(c,d)) ?

    Thanks again
    John

    Currently Using Alpha ver 12.4.4.4. Build: 4346; Addins: 4889 against MySql databases

    Church Job Finder
    A Church of England Enabling Recruitment Partner "Right People, Right Place, Right Time"

  5. #5
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,257

    Default Re: Lowest of three fields

    Hi John,

    Sorry about the confusion. I offered that suggestion specifically because you were asking about lowest value of 3 fields.
    With that said, you would need one extra comparison to make this work.
    calcField = case(a<b,min(a,c),b<a,min(b,c));calcField = min(calcField,d) does the trick.

Similar Threads

  1. Wanted POS App for Sale (Lowest Bidder)
    By JetLi in forum Alpha Five Version 11 - Desktop Applications
    Replies: 25
    Last Post: 12-20-2012, 04:31 AM
  2. How to get lowest 5 values from a field list?
    By jkletrovets in forum Alpha Five Version 9 - Desktop Applications
    Replies: 6
    Last Post: 06-09-2008, 10:57 PM
  3. Second lowest from nested min(min(A,B),C)
    By admin@dcitelecom.com in forum Alpha Five Version 5
    Replies: 4
    Last Post: 10-14-2003, 08:57 AM
  4. Second lowest from Nested Min(Min(a,b),c)
    By admin@dcitelecom.com in forum Alpha Five Version 4
    Replies: 1
    Last Post: 10-11-2003, 04:25 AM
  5. Finding lowest Value
    By russ Boehle in forum Alpha Five Version 4
    Replies: 4
    Last Post: 04-23-2001, 04:46 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
  •