Why variables are used on statistics pages and not fields?

Brax007
Member Posts: 26
Hello everyone,
I have this question confusing me since forever, When do I use fields and when to use variables to have dynamics values calculated when opening a page?
what's wrong with the use of fields from a table instead of variables ?
Thanks in advance
I have this question confusing me since forever, When do I use fields and when to use variables to have dynamics values calculated when opening a page?
what's wrong with the use of fields from a table instead of variables ?
Thanks in advance
0
Best Answer
-
The same reply that I gave you earlier is the same. How many fields would you need for monthly totals? 12 for 1 year, 24 for 2? 52 for weekly? 104 for 2 years of weekly totals? What if you have 5 different types of calculated values... you'd have to add 640 fields to store those values (5 * 24 + 5 * 104). It's just not practical.
Besides, you'd be storing calculated values that are dynamic and out of date as soon as you post a new transaction. You'd also have to calculate those values every time you open the page anyway, to make sure that the numbers are still correct.
Using the current capability, you'd create 5 flowfields with a dependency on a 'Date Filter' flowfilter, and all you have to do is reset the filter and do a CALCFIELD and you're done with just a couple lines of code.5
Answers
-
Statistics pages ARE using fields, they are just used to set variables in the page in the logic that renders the statistics pages. Many statistics pages use the same field multiple times with different filters.
Take, for instance, the Item Statistics page. You can show values per day, week, month, year. Those values are calculated based on the user selection when the matrix is calculated. There is no way to provide those values as flowfield values. Let's say you want to show values by month. Do you create 12 fields for 12 months at the table level? Is that enough? What about the need to compare last year's values? Do you create 24 columns for month? Let's say you want values by week, how many fields do you create? 12 for a quarter? 26 for half a year? 52 for a whole year? Do you then need 104 columns to also have last year's numbers?
A statistics page uses the same field and calculates it however many times you need for however many columns you need. You start the Item Statistics page and debug it, with selecting different settings. See what it does, discover how it works. Do the same for Customer Statistics, and order statistics. Get a feel for how it really works.1 -
Thank you DenSter for your response, but in general, in a page if you have data calculated on an open page for example, what's the difference between using variables to stock the result and show it on the page or juste stock the result in a table field?0
-
The same reply that I gave you earlier is the same. How many fields would you need for monthly totals? 12 for 1 year, 24 for 2? 52 for weekly? 104 for 2 years of weekly totals? What if you have 5 different types of calculated values... you'd have to add 640 fields to store those values (5 * 24 + 5 * 104). It's just not practical.
Besides, you'd be storing calculated values that are dynamic and out of date as soon as you post a new transaction. You'd also have to calculate those values every time you open the page anyway, to make sure that the numbers are still correct.
Using the current capability, you'd create 5 flowfields with a dependency on a 'Date Filter' flowfilter, and all you have to do is reset the filter and do a CALCFIELD and you're done with just a couple lines of code.5 -
In a variable you can do much more then in a stored field, or a dynamically calculated flow field. For example the "stock value" is a rather simple calculation from stock * cost price, but when you use different cost price methods, it is already more sophisticated. But without variables, you can't calculate it for sure.IF User.Loves('Edo') THEN ok() ELSE currReport.genSkip;1
-
Statistics page (when you press F9) all the data is calculated dynamically, that´s why it uses variables to place it in the screen (a bunch of arrays and other calcs)
1
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