Options

Counting two colum fields together form

KisuKisu Member Posts: 381
If I have a list type of a Form
is it possible to count two of the colums by dividing the fields on them to another/new column

Like

Col 1 | Col 2 | Col 3
10 | 20 | sum of(10/20)
5 | 8 | sum of(5/8)


col 3 would be the division of col 1 and 2 for each line
etc.?
K.S.

Answers

  • Options
    KisuKisu Member Posts: 381
    hmm off this went to NAV Three Tier forum even I posted this on NAV/Navision Classic Client :shock:

    Anyways, I'm looking this kind of solution for Form, not Page
    K.S.
  • Options
    AdministratorAdministrator Member, Moderator, Administrator Posts: 2,496
    [Topic moved from 'NAV Three Tier' to 'NAV/Navision Classic Client' forum]
  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Normally with these calculations you can put it directly in the SourceExpr of a new column. This accepts small formula's.

    However since you want a division, you need to make sure, not to invoke a division by zero exception. Therefore it should be in a function.

    Best solution would be to create a new function on the table that returns the calculation or zero if you pass zero as the divider.

    Please remember that you will not be able to filter on this new column.

    Also, this solution works 100% transparant for both Forms in the classic client and Pages in the RTC.
  • Options
    KisuKisu Member Posts: 381
    Yay works, thanks :)

    What I did was:
    Created a new column on the form.
    Created new function that takes the two other colum fields as parameter and returns the counted value
    Added caption and caption ml for the new column and the function call with the two parameters
    K.S.
  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
Sign In or Register to comment.