Calculation of data

Horse06
Member Posts: 496
Hi expert, I have a little trouble in one program. We added some persons (Sales Assistant) in the Salesperson/Purchaser table and added extra field Sales Assistant which we added in the Salesperson/Purchaser in the Sales Order form. We need to create a report and calculate how many sales sold by each salesperson and sales assisant. I can create a report separately(one for salesperson, one for sales assistant). My question is how I can put salesperson and sales assisant together in one report.
Check one selection( sales including salesperson and sales assistant) and calcualte the total sales order and amount.
Check another selection(Sales excluding Sales Assistant) and calculate the total and this need to deduct the sales from sales assistant.
The output is like this:
Salesperson XXX
Sales Order 12
Salesperson XXXX
Sales Order 15
Total Sales Order 27
I tried to program like this:
Create two sections: A) one for salesperson with sales Assisatant
One for salesperosn without sales Assistant
In A) Currreport.Showoutput((Salesperson Code='xx' )or (salesperson Code='yy'
In
add something like A, but show different code.
The problem is if we want to retrieve the data for those without sales assistant, they are the same as the sales with assistant including the total sales order.
Expert how can we create one report for all functionality. Thanks!!!
Check one selection( sales including salesperson and sales assistant) and calcualte the total sales order and amount.
Check another selection(Sales excluding Sales Assistant) and calculate the total and this need to deduct the sales from sales assistant.
The output is like this:
Salesperson XXX
Sales Order 12
Salesperson XXXX
Sales Order 15
Total Sales Order 27
I tried to program like this:
Create two sections: A) one for salesperson with sales Assisatant

In A) Currreport.Showoutput((Salesperson Code='xx' )or (salesperson Code='yy'
In

The problem is if we want to retrieve the data for those without sales assistant, they are the same as the sales with assistant including the total sales order.
Expert how can we create one report for all functionality. Thanks!!!
0
Comments
-
If the sales assistant code is not available in the ledger entry, you can use the order document, provided it isn't deleted after invoicing.
You can use the document no. of the value entry to find the sales invoice header. Here is a field "Order No.", by which you can find the Order. If you have checked "Only Sales without assistant", codeIf OnlySalesWithoutAssistant then If SalesOrder."Sales Assistant" <> '' then Currreport.skip;
If the Orders are deleted after invoicing, create the "Sales Assistant" field in the posted documents tabe too using the same field ID ( Sales Invoice , Credit Memo etc.). This is advisable in any case to prevent these field ID's being used for other purposes ( this would result in posting errors or false field values)
If the sales assistant code is copied to the ledger entries, it would enable to define new flowfields and flowfilterfields ( date , location etc.) in the Salesperson table which would calculate all values at once. In this case, Codeunits 22 and 80 have to be modified to copy the field values and at least one additional key with Sumindex for the Sales Amount is needed for the value entries.Kai Kowalewski0 -
Thanks! I am working on this right now. I have another question for you. In the dataitem, I group the salesperson. But I want to create another section in the report to group the sales assistant. I create a boolean and in the option tab, when the boolean variable is checked, I want to calculate the total by the sales assistant. How can I Code Group the sales Assistant? Thanks!0
-
To create group totals , you need the CREATETOTALS Function ( or Property ) and the TOTALSCAUSEDBY Function in a group footer section of the report. The online help will tell you more about these functions.Kai Kowalewski0
-
Kowa wrote:To create group totals , you need the CREATETOTALS Function ( or Property ) and the TOTALSCAUSEDBY Function in a group footer section of the report. The online help will tell you more about these functions.
Just one more consideration is there needs to be a Key, with the fields in
Field 1, Field 2,Field 3
Each element of the key can create a group and a total
Would give you grouping sections
Report Header
Field 1 group Header
>>Field 2 group Header
>>>>Field 3 group header
>>>>>>>Detail Line
>>>>Field 3 group Footer
>>Field 2 group Footer
Field 1 group Footer
Report footer
Use the wizard to create a grouped report and study the sections PreDataItem code
Looking again at your original post, if I am right you have two fields on the sales header, Sales Person and Sales Assistant, if so you can just add a Key to the Sales Header for your Sales Assistant, and in your report create two dataItems
one grouped by Sales Person where Sales Person <> '', and the other grouped by Sales Assistant where the Sales Assistant <> ''Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0
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