Sage Reporting – Sage 200 Reporting – Sage 200 Reports:
Help and Support:
Call 0333 050 9051 or email using the contact pages for free and friendly advice.
BINARY Choice. – Yes or No, True or False, On or Off.
There are just two options – Combining these two states can enable multiple combinations to be represented as a single number.
The above demonstrates how numbers and their BASE representation can be used to record a set of binary states.
The set of EIGHT Yes or No options to identify the FORMs assigned to the new Customer Alerts text is being represented by a single number in Base10
Report # 168 – Sales Ledger Customer Alerts report uses the binary representation of the EIGHT possible FORMs that have or have not been selected against each alert test.
To convert the value held in the FORM variable back to its binary (Base2) equivalent we need to devise a set of calculations that can hold the fact that each of the eight columns is either a ‘1’ or ‘0’
The trick to break down the Base10 number into Base2 is to evaluate from left to right.
If the FORM number is >=128 then the first column must be ‘1’
(Setting all the other columns to 1 only adds up to 127)
We repeat a similar test for the other columns and obtain the ‘0’ or ‘1’setting for all columns.
Each test result will be held in its own variable and be recorded not as ‘0’ or ’1’ but as ‘0’ or ‘2n-1’ (where n = the column reference, working backwards).
Create a variable P8 with an if-then-else statement to check the value of the FORM variable. P8 will then hold either 128 or 0
Variable P7 is a similar calculation where the FORM number is reduced by the value of P8 and then tested to see if it is >= 64
Use the See Nore>> options to expand the Examples.
EXAMPLE 1 – The calculation format
EXAMPLE 2 – Worked example when FORM = 255
EXAMPLE 3 – Worked example when FORM = 86