How show the maximum and minimum values

markyT
Member Posts: 120
Hello, I've a report that shows simply list of registers from "Item Ledger Entry" table. One of this fields is "Invoice quantity" field. I want to show, in a footer section, the maximum and minimum value from the this field from those shown. How it would the code to do this, please?.
Thanks in advance.
Thanks in advance.
0
Comments
-
Hi,
I don't think there is any function or a property which can get the maximum value. :-k
The Only way is to check the "Invoiced Quantity" onaftergetrecord() every time and keep the highest in a variable and display it at the end. :roll:0 -
Thanks for reply; what you're proposing would be enough for me. Can you explain me how I can do that by code, please?.
Thanks.0 -
Simple..
Define Variable Qty of type Decimal.
Initialize Qty:=0;
onAfterGetrecord()
IF Qty < "invoiced Quantity" THEN
Qty:= "invoiced Quantity";
Display Qty in Footer.0 -
Hi,
could be solved with a Key with Invoiced Quantity as first field. Used in Tables 266, 267 and 268. Use FINDFIRST or FINDLAST in code to get the Min and Max values.
Or you could use GETRANGEMIN and GETRANGEMAX in code when you filtered out the recordset. See Help for details on these functions.
Finally a flowfield could be used with Min or Max in the CalcFormula.0 -
kapamarou wrote:suvidha wrote:Initialize Qty:=0;
onAfterGetrecord()
IF Qty < "invoiced Quantity" THEN
Qty:= "invoiced Quantity";
Just be careful how you handle Negative Values if they exist...
Yeah right.... :!:
For maximum Inv Qty ...
onAfterGetrecord()
IF Qty=0 THEN
Qty := "invoiced Quantity"
ELSE IF Qty < "invoiced Quantity" THEN
Qty:= "invoiced Quantity";
For mimimum Inv Qty....
onAfterGetrecord()
IF Qty1=0 THEN
Qty1 := "invoiced Quantity"
ELSE IF Qty1 > "invoiced Quantity" THEN
Qty1:= "invoiced Quantity";
Hope u dont find ILEs with Invoiced Quantity = 0 !!!!0 -
Thanks for reply but the code:
Initialize Qty:=0;
onAfterGetrecord()
IF Qty < "invoiced Quantity" THEN
Qty:= "invoiced Quantity";
Doesn't runs well, It gave me the last register, not the minimum; any idea please?0 -
Sorry so much, I've forgotten to inicialite the Qty. It runs perfectly. Thanks everybody for help.0
-
Flowfield:
CalcFormula = Min(MyTable.MyField) or
CalcFormula = Max(MyTable.MyField)My candle burns by both ends, it will not last the night,
But oh my foes and oh my friends, it gives a lovely light0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions