Alpha DevCon 2018
Results 1 to 8 of 8

Thread: Help with the expression genie

  1. #1
    Member
    Real Name
    Penny Barnhart
    Join Date
    Dec 2008
    Posts
    29

    Default Help with the expression genie

    Hello, I am new - have posted newbie questions within the last couple of weeks....
    I am having difficulty with the expressions. I look at other examples within the A5V9 but do not "have the knack" to writing the expressions. I could "wizard" my way around the less complex functions in Excel - but finding myself truly stuggleing with A5 expression builder.

    What I am attempting to create is a value (number of days based on several items) that could be returned based on the Status of a load (A-active,C-shipped, or blank). If the status of the load is A, then return the value System date <-> date received (number of days)....if C, then return the value from Lotship(table)Dateship (field) - Daterec, lastly if status is blank return 0 or " ".
    What was used with the old version (A4V7) was the following:

    IF(Status="A", System->Date-DateREC, if (Status="C",Lotship->Dateship-DateREC, If (Status=" ",System->Date->,System->Date,System->Date-System->Date)))

    This is used on a form (multiple use) at new input, at browsing, at shipping.
    Thank you for any help you can give me.

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,005

    Default Re: Help with the expression genie

    Case() is much easier to construct, IMHO.

    Code:
    Case(Status="A", System->Date-DateREC, Status="C",Lotship->Dateship-DateREC, Status=" ",System->Date)
    The first true statement working left to right causes the paired (color indicated here) result to be returned.

    I would suggest you use date() rather than system->date.

    Code:
    Case(Status="A", date()-DateREC, Status="C",Lotship->Dateship-DateREC, Status=" ",date())

  3. #3
    Member
    Real Name
    Penny Barnhart
    Join Date
    Dec 2008
    Posts
    29

    Default Re: Help with the expression genie

    I placed this into the calculated field (expression area) have got the invalid or incomplete expression.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,005

    Default Re: Help with the expression genie

    Hard to diagnose without a sample database and/or the context.

    You can start by building something that does work and expanding. Try

    Case(Status="A", date()-DateREC)

    if this works, try adding the other logical test,result pairs one at a time. If it doesn't you may need to qualify the DateREC with its table name

    Case(Status="A", date()-sometablename->DateREC)

    Are the DateRec and Dateship in the same table? Is the form built on a set using tables containing both fields?

  5. #5
    Member
    Real Name
    Penny Barnhart
    Join Date
    Dec 2008
    Posts
    29

    Default Re: Help with the expression genie

    Well, I am failing my task. I feel perhaps that I am not at all correct in my execution. Would it be better if I zipped the database and emailed?

  6. #6
    Member
    Real Name
    Penny Barnhart
    Join Date
    Dec 2008
    Posts
    29

    Default Re: Help with the expression genie

    DateRec is in Lothead, Dateship is in Lotship.
    Form based on set with both tables, yes

  7. #7
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,005

    Default Re: Help with the expression genie

    You can attach a zip of your database here. Meanwhile try

    Case(Status="A", date()-Lothead->DateREC)

    I neglected to ask where the status field is. You may need to qualify that as well.

    Case(Lothead->Status="A", date()-Lothead->DateREC)
    or
    Case(Lotship->Status="A", date()-Lothead->DateREC)

    depending.

    Normally you do not need tablename-> for the primary table of the set (it is assumed) but you do need it for all other fields from other tables.

  8. #8
    Member
    Real Name
    phuongtim39
    Join Date
    Mar 2010
    Posts
    2

    Default Re: Help with the expression genie

    I accept with information:that could be returned based on the Status of a load (A-active,C-shipped, or blank). If the status of the load is A, then return the value System date <-> date received (number of days)....if C, then return the value from Lotship(table)Dateship (field) - Daterec, lastly if status is blank return 0 or " ".

Similar Threads

  1. Genie
    By Ron Jones in forum Alpha Five Version 6
    Replies: 2
    Last Post: 02-23-2005, 07:23 AM
  2. Genie does not appear
    By Haroon Haffejee in forum Alpha Five Version 6
    Replies: 3
    Last Post: 08-01-2004, 04:36 PM
  3. Genie
    By jeresmall in forum Alpha Five Version 5
    Replies: 2
    Last Post: 06-01-2004, 03:49 AM
  4. new db with genie
    By Greg Ware in forum Alpha Five Version 5
    Replies: 3
    Last Post: 05-15-2004, 07:54 AM
  5. X-dialog genie
    By Ryan Ware in forum Alpha Five Version 5
    Replies: 2
    Last Post: 06-05-2003, 10:12 AM

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
  •