Omnis Mysql defined list

Jonathan Rumbold jr at omnipotent.com.au
Thu Dec 15 23:18:23 EST 2016


I can't be sure Stephen. It's a case of suck-it-and-see! I don't use the calculated columns in query classes much, but from memory, the existence of parentheses triggers it's treatment as a calculation.
Good luck 😊

..................................
Jonathan Rumbold

On 16 Dec. 2016 2:50 pm, Stephen Baugh <stephenbaugh at queensberry.com> wrote:
Thank you, Jonathan, and Doug, these are exactly what I want to do.

Jonathan, can I confirm what you have said.

Do you mean you put the mysql calculation eg …

SELECT ROUND(C_SUPP_BAL_MTH / if(REG_EXCHANGE_RATE, REG_EXCHANGE_RATE, 1)) )

… in the Omnis Query Class (second column) and the alias in the third column, or do you mean you create a dummy field in the definition and the populate the list with a select calculation that does the calculation?

Thanks
Stephen



On 16/12/16, 12:03 PM, "omnisdev-en on behalf of Jonathan Rumbold" <omnisdev-en-bounces at lists.omnis-dev.com on behalf of jr at omnipotent.com.au> wrote:

    Hi Stephen,

    I'm not sure about that, but you can add calculated columns to a query class prior to defining the list. The calculation needs to be SQL, so you could call a function in your DB to deliver the goods.

    ..................................
    Jonathan Rumbold

    On 16 Dec. 2016 9:42 am, Stephen Baugh <stephenbaugh at queensberry.com> wrote:
    Hi Everyone

    Is there a way to add columns to a .$definefromsqlclass list definition, so that a calculation is processed as the list is built?

    This might be a pick lookup or math function etc

    I want to add for example, the following calculations to this definition, after of course adding the new columns separately if required.

    Do $cinst.iWindowList.$definefromsqlclass($cinst.iRowTableName) Returns lvStatus

    Calculate Month as ovControl.$doDivide(C_SUPP_BAL_MTH,REG_EXCHANGE_RATE)
    Calculate Current as ovControl.$doDivide(C_SUPP_BAL_CUR,REG_EXCHANGE_RATE)
    Calculate 30days as ovControl.$doDivide(C_SUPP_BAL_30,REG_EXCHANGE_RATE)
    Calculate 60days as ovControl.$doDivide(C_SUPP_BAL_60,REG_EXCHANGE_RATE)
    Calculate 90days as ovControl.$doDivide(C_SUPP_BAL_90,REG_EXCHANGE_RATE)

    Both C_SUPP_BAL_MTH and REG_EXCHANGE_RATE are defined in the list definition.

    I hope this makes sense, and as always thanks for the help.

    Cheers
    Stephen



    _____________________________________________________________
    Manage your list subscriptions at http://lists.omnis-dev.com


    _____________________________________________________________
    Manage your list subscriptions at http://lists.omnis-dev.com


_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com



More information about the omnisdev-en mailing list