Mike Allen Systems

Doing Smarter Things With IT

Information Ownership and Responsibility

All the information in a business system has an owner, what is interesting is that the owners of information may be unaware of its existence and their responsibilities as an owner. A computer system is a model of a business system, not a perfect model but a useful model. This is a generalization that applies to many types of model. Ownership and responsibility are implemented via business rules, which may be implemented in both code and data.

The owner of information may be the creator, the maintainer of even the reader of information. You will not find ownership by looking at the data or even at the code, it is intrinsic to a business system. The owner is responsible for the processes that affect information. What is even more interesting is that ownership is contextual and can vary over time.

Let’s dig a little deeper into the concept of ownership. An owner may be a person but is better described as an actor. An actor may be an entity like the accounts department, so that ultimate responsibility may lie with the manager of that department however ownership will be implemented by proxies such as accounts clerks and computer systems. As a piece of information travels through the business system , context changes, and ownership may change. For instance, as a customer transforms from a lead to an opportunity and then becomes a customer. So a piece of information can have multiple owners, but a sensible business rule would be for an instance of information to only have one ultimate owner for any given context. These actors should exist in a hierarchy with the ultimate owner delegating down the hierarchy of contextual actors and their proxies.

Why is this important? Well, information ownership is implicit in any business system and in order for a business system to function in a predictable fashion you need to know who is responsible for your data. Let's get back to customers, the core of any business. A business system is a model itself that will consist of several computer systems at various levels of integration. The problem is to identify a customer uniquely across all the systems that they are with. Duplicate (or more) customer records are the bane of any organization and ownership of customer identity is essential for managing customers. Duplicate records should be the exception, not the rule.

An example is often found in payment systems, businesses have multiple methods of making payments which often leads to multiple methods of generating account number. An account number and associated customer records should be raised by the information owner or their proxy. For those that would say this is impractical, I would say that this is what we have computer systems for. My favourite complaint is the use of cut and paste in business environments. Successfully implemented ownership will eliminate this.

Identification is the key to managing information ownership. Information ownership is the key to quality data. Quality data is key to high functioning computer systems and the resultant data analysis for decision management using BI and AI tools.

Analysis, design and improvement of business systems and the computer systems rely on establishing lean efficient information management. But let’s move on to the ownership of transactional data. Transactions frequently flow across multiple computer systems and multiple owners. An order is raised from a website entered into payment systems, general ledgers and order systems. At the end of the day we must be able to reassemble this information into unique transaction in order analyze sales performance.

This is a complex area that can yield high returns in the areas of business efficiency and planning, but again it requires identifying areas of responsibility. Then when dealing with business rules for tricky areas such as refunds and warranty, we will know which actors are involved.

When we know who owns the information we can also better identify the consumers of information, but I’ll leave that for another day.

Lean Information Governance

Good decision making is predicated on good information. A simple statement of the obvious. Who would want to run a business using poor quality decisions? This is all good in theory, what happens in practice is generally less than ideal. I’m going to treat that as a given.

When we proceed down the path of Business Intelligence(BI) and Artificial Intelligence(AI) we assume that our data is good enough and up to the task. Information is tricky stuff, sometimes we are not even aware of it until after the event that generated it has passed. Information also relies on the quality of the underlying data. Data can be defined succinctly, but information must be good enough for the task at hand.

Information governance is about ensuring that sources of information produce adequate and effective data of good quality. One of the principal issues of efficient data collection is knowing what data needs to be collected for an event or function that triggers the collection process. Suppose that you are recording the arrival of passengers at a train station, what data do you collect? Ticket number, destination, size, weight, how they arrived?

If the metrics of decision making are known the source data may be collected. Metrics are defined by combining source data which may be referential or transactional. Referential data is collected when the referential entity, such as a customer is identified for transactional purposes. Referential data, once collected must be maintained on a regular basis. Maintenance of referential data is one of the most important parts of data governance.

Maintaining referential data must be an ongoing task, some aspects can be usefully outsourced, such as credit ratings and corporate addresses. Personal details need to be kept up to date and meaningful, audit trails need to be kept. The concepts of master data need to be explored and responsibility and ownership of data need to be understood. This understanding needs to extend beyond business analysts and management. Data knowledge is an essential part of business culture, as relevant information is essential to the good operation of a business.

Transactional data is the lifeblood of any organization. Transactional data represents business activity and is the source of the fact tables that drive BI and AI. Transactional information is best collected as close to the source, in both time and location, as is possible. It is much harder to determine the essential data of a passenger at the destination than at the origin, purely because the start of a journey starts a transaction, whereas arrival at a destination implies a transaction in progress. Transactional data is inherently mutable, states and values change as the transaction is processed through the system. Process (or is that data?) analysis may indicate that we don’t need to record departures and arrivals as a single transaction. Then a change to the process, such a rewards system, makes it a necessity.

An excellent indicator of the utility of transactional data is how it is used. If it is used ubiquitously and is the one source of truth, it is very healthy data. If there are a variety of shadow systems that produce alternative versions of the truth, there will be issues with the data collections process. When the same information is collected multiple times (I’ve already been asked that a dozen times), that is a prime indicator of transactional torpor. In the same way, that reference data must have a master, transactional data must have a master and ownership. Transactional data often spawns subsidiary transactions in accounting ledgers and order books. These transactions must refer to the same reference data and this requirement must be handled in an appropriate fashion.

The key message here is that data is not separate to process, it is an intrinsic part of any process. Creators and consumers of business data need to have full awareness of what general and specific process rules exist in an organization. Another key concept is DRY (Don’t Repeat Yourself), collect information once. as efficiently as possible. Information Governance should be part of organizational culture. Executive responsibility for information governance must nurture that culture.

Being lean does not require a specific methodology, but lean information governance should be part of any continuous improvement effort. When you are faced with the latest flavour of business improvement, ask yourself if it incorporates better informational awareness into the process.

Analyzing The Edge (Look before you leap)

All computer systems have edges, edges in space and time. Computer Systems have attractive cores, so that they survive, but out at the edges they have less attractive features. This is part of the organic nature of systems they have a start and an end and they occupy space in a business, they also interweave and overlap the business process that they enable. In any system the edge is a key point of failure, the place where assumptions and assertions tend to fail.

Working the edges requires some good problem, cost and risk analysis skills. Think of this as stress, money and time factors. Ideally these problems are addressed at the leading edge, but it is not possible to address all these issues before they occur. We must address edge issues continuously, in an agile fashion; the edge is a place to look for potential issues.

The leading edge changes it’s profile over time along with the system lifecycle. Early edge events are important as they strongly influence system viability, that’s success or failure, but also core future areas like usability. Usability issues typically present as edge issues, such as interfaces to other systems, but in poorly designed systems will present as a core issue. Design is a leading edge issue, too little design leads to usability problems, over design will slow progress and often lead to rework. There is a sweet spot for leading edge issues, you may not know exactly where it is, but you can head towards it by making informed decisions.

The most common method of creating an edge issue is ignorance, mainly of the ‘it’s not important’ variety, making misguided assumptions because it is easier. This leads to assumptions that a problem is simple, therefore it requires no design thinking. Cost benefit and risk analysis are an important part of design and always should be considered.

A high  level design that can be justified by a few simple metrics, not only focuses thought, it aids collaboration. Analyzing the edge quantifies the area of interest with questions like how much, how many and how often? This leads to what does it cost and why do we do this? What are our usability profiles.

Interfaces with other systems are key edges. How is data synchronized, is there a master? Interfaces can fall into disrepair, then they are propped up my human intervention and this becomes a new workflow. People become accustomed to working around edge issues and may sometimes feel that that is how the system works. These issues can be hard to detect and address, but yield large benefits when they are fixed.

This is about getting more value from your software, data and technology, edge cases are a great place to start.

On Upgrading to a New Website

I have a business web site at Mike Allen Systems, I had already done some design and content and was ready to add some more business content and improve the graphics.

In the design process I had gone back to basics and used HTML and CSS, using W3-CSS to give me a simple responsive layout. That was all good: basic, simple and responsive, so I’d ticked all those boxes. One area of technology I’d fudged slightly was the layout, I’d used HTML server side includes for my headers, footers and menu. All this with minimal JavaScript. The problem I now had was how make the web site easily extendable in order provide more business functions.

I have to admit that the moment I started writing HTML and steering away from JavaScript, I had set my direction. I’d just set up a WordPress site for a customer, and while I respect WordPress, I wasn’t going to go there for my own needs. I have some programing skills in C#, so I looked at Razor Pages . This wasn’t a simple choice, I tried various aspects of creating just Razor Pages with a Layout replacing the includes, that was the simple bit. Then I got into creating an ASP .NET Core 2 application, which I discovered gave me what I needed, particularly for form pages.

Converting my pages to a Razor project was simple and tested nicely on the desktop. I used SendGrid on my contact form, that is nice and clean to use. What I hadn’t really considered was how to deploy this fairly new technology. My current web host didn’t support ASP .NET Core 2 on my server. Bummer! I regrouped and deployed to Azure and that was OK. I looked at Custom URL and SSL on Azure and found that put me in a higher price range. I looked for a more suitable host.

Finding a good host has always been one of the trials for web sites. Sometimes and excellent host will be taken over and service will decline, and the opposite can happen and a host can dramatically improve services. I’ve been using Crazy Domains for years for domain registration. Years ago their support for the .NET I needed was limited, but I gave them a call to see if they supported Core 2, and they did. I deployed and was up and running straight away.

This was a fairly simple technology upgrade for a web site, but it still consumed time and effort. My take away is to always consider deployment up front as part of the planning process, in order to avoid obstacles in the path of successful completion. It’s also important to be flexible, so I did write a little JavaScript to power my quote engine.

In summary, don’t forget to plan, but don’t expect activities to progress as planned, there are a lot of components involved in a web site upgrade, so allow time for discovery of issues and remediation. I also found the upgrade led me to consider other issues, such as how I manage images, keywords and content, that is for future projects.

Improved Xero Invoice extraction using Linx

Having successfully extracted Xero invoices using Linx, I decided to drill deeper an improve my understanding and methods.

My aim is still to extract the invoices and load them into Power BI, but now I have the additional target of loading the invoices into CosmosDB and then loading the CosmosDB collection into PowerBI, and eventual Azure Analysis Services.

I improved my understanding of Invoice Type, realizing that the data was both Accounts Receivable and Payable.

Here’s a sample of the data:

{
         "id":"0032f627-3156-4d30-9b1c-4d3b994dc921",
         "InvoiceType": "ACCPAY",
         "InvoiceDate":"2017-09-11",
         "InvoiceNumber":"9871",
         "Status":"PAID",
         "Total":148.5,
         "SubTotal":135.0,
         "TotalTax":13.5,
         "TotalDiscount":0.0,
         "DueDate":"2017-09-20",
         "ContactId":"d6a384fb-f46f-41a3-8ac7-b7bc9e0b5efa",
         "ContactName":"Melrose Parking",
         "UpdatedDate":"2008-09-16T20:28:51.5+10:00",
         "Reference":"",
         "AmountDue":0.0,
         "AmountPaid":148.5,
         "Url":null,
         "Partition": "201709"
     }

Key takeaways:

    1. The ‘id’ is critical and must be named that to map to the id in the Cosmosdb
    2. That Url, while null in the example, is the url of the Invoice PDF
    3. I’ve added a ‘Partition’ field for CosmosDB and Analysis services use.
    4. I’ve trimmed the time off InvoiceDate and DueDate
    5. All the JSON formatting is done in Linx

Here’s a pic of the Linx project:

image

That InvoiceItem is a type I’ve defined with the format for the JSON

My thinking is that as the invoice status changes I can update CosmosDB using the id, the CosmosDB API has an ‘Upsert’ functionality which will do this neatly. The intention being to extract Xero Invoices that have changed in the last day on a daily basis using Linx and then upsert them to the CosmosDB and then refresh the Power BI/ Analysis Services Model.

I’m using a very simple C# program to do the upsert, this is all dynamic, with very little code.

foreach(dynamic invoice in invoices)
            {             
                await this.client.UpsertDocumentAsync(UriFactory.CreateDocumentCollectionUri(databaseName, collectionName), invoice,options);
            }

This code doesn’t care what the invoice looks like, the CosmosDB has no schema, but I insert into a collection called ‘Invoices’ with a consistent layout.

Also it is still possible to load the JSON directly to PowerBI, the query is very simple:

let
     Source = Json.Document(File.Contents("C:\Users\Mike\Documents\LinxOutput\invoice.json")),
     #"InvoiceTable" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
     #"Expanded Column1" = Table.ExpandRecordColumn(InvoiceTable, "Column1", {"InvoiceDate", "InvoiceNumber", "Total", "Status", "id", "SubTotal", "TotalTax", "TotalDiscount", "DueDate", "ContactId", "ContactName", "UpdatedDate", "Reference", "AmountDue", "AmountPaid", "InvoiceType", "Url"}, {"InvoiceDate", "InvoiceNumber", "Total", "Status", "id", "SubTotal", "TotalTax", "TotalDiscount", "DueDate", "ContactId", "ContactName", "UpdatedDate", "Reference", "AmountDue", "AmountPaid", "InvoiceType", "Url"}),
     #"Changed Type" = Table.TransformColumnTypes(#"Expanded Column1",{{"InvoiceDate", type date}, {"DueDate", type datetime}})
      in
     #"Changed Type"

If you’ve got this far, thank you for your interest, there’ll be more on Xero, Linx, CosmosDB and PowerBI in the near future.

Application Authenticate using public/private key pairs

Recently I’ve been using no-code and low-code solution to build small business applications. I’ve had to learn more about authentication using public/private key pairs, which I’ve normally had other people look after for me, but now it’s time for me to do it myself. After a read of the Wikipedia article https://en.wikipedia.org/wiki/X.509

First up the business scenarios. My web site uses https://letsencrypt.org/ certificates, a fantastic free service, it’s built into my web portal so I just nee to know it’s there, simple. Then there was the e-commerce site where I had to take a commercial certificate and install it on an Azure web site, a little bit of manual prep, bit largely automated by the portal.

Then something more complex, I wanted to use an Azure function to talk to SharePoint online. I checked out this post https://blogs.msdn.microsoft.com/richard_dizeregas_blog/2015/05/03/performing-app-only-operations-on-sharepoint-online-through-azure-ad/ , which told me almost everything that I needed to know. One important lesson was that the AAD app acts as a portal to SharePoint online, so once I had one app working, all my azure functions then used the same AAD app for access to SharePoint online. This is still a work in progress for me, I was motivated by a need to insert images from a Power App, then I realized that this opened the door to other business needs, such a creating a PDF from a SharePoint item.

Then I got back to my core business driver, Business Intelligence, and my current area of interest, Xero. I was looking for drag and drop access to Xero data, with a simple connector. At this point I looked at the new https://linx.software/ Xero connector, and was a little put off that I needed a Consumer Key, and a secret to use the Xero API. All too hard I thought! Then I looked close and realized if all used a certificate, I read this https://developer.xero.com/documentation/api-guides/create-publicprivate-key and then created a new cert. The I created a private Xero App with my certificate and it all fell into place.

I’m not an expert on certificates  by any measure, but now I know enough to integrate my Xero with Power BI using Linx, that will be my next adventure.

Get Invoices from Xero to Power BI using Linx

I have a side project exploring low-cost and low-code ways of interfacing with Xero. I’ve extracted data using Linx from https://linx.software/ , a useful low-cost software solution.

You need to create a private Xero App at https://developer.xero.com/documentation/auth-and-limits/private-applications , this is actually fairly simple. Generating the certificate is the most difficult bit, see my blog https://mikeallen.com.au/post/Application-Authenticate-using-publicprivate-key-pairs.

Once that is done set up a Linx job with two steps:

1/ GetInvoices

2/TextFileWrite

It’s all pretty self-explanatory and it will generate a nice json file for you.

Import the json into Power BI using Power Query, the Date formats are a bit tricky because there’s a time zone in there. I’ve fixed the ‘Date’ column to make it just a Date.

Here’s the query:

let
     Source = Json.Document(File.Contents("C:\Users\Mike\Documents\LinxOutput\LinxInvoices.json")),
     #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
     #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"Type", "Contact", "Date", "DueDate", "Status", "LineAmountTypes", "LineItems", "SubTotal", "TotalTax", "Total", "TotalDiscount", "UpdatedDateUTC", "CurrencyCode", "CurrencyRate", "InvoiceID", "InvoiceNumber", "Reference", "BrandingThemeID", "Url", "SentToContact", "ExpectedPaymentDate", "PlannedPaymentDate", "HasAttachments", "Payments", "CreditNotes", "Prepayments", "Overpayments", "AmountDue", "AmountPaid", "FullyPaidOnDate", "AmountCredited"}, {"Type", "Contact", "Date", "DueDate", "Status", "LineAmountTypes", "LineItems", "SubTotal", "TotalTax", "Total", "TotalDiscount", "UpdatedDateUTC", "CurrencyCode", "CurrencyRate", "InvoiceID", "InvoiceNumber", "Reference", "BrandingThemeID", "Url", "SentToContact", "ExpectedPaymentDate", "PlannedPaymentDate", "HasAttachments", "Payments", "CreditNotes", "Prepayments", "Overpayments", "AmountDue", "AmountPaid", "FullyPaidOnDate", "AmountCredited"}),
     #"Expanded Contact" = Table.ExpandRecordColumn(#"Expanded Column1", "Contact", {"ContactID", "ContactNumber", "AccountNumber", "ContactStatus", "Name", "FirstName", "LastName", "EmailAddress", "SkypeUserName", "ContactPersons", "BankAccountDetails", "TaxNumber", "AccountsReceivableTaxType", "AccountsPayableTaxType", "Addresses", "Phones", "IsSupplier", "IsCustomer", "DefaultCurrency", "UpdatedDateUTC", "XeroNetworkKey", "SalesDefaultAccountCode", "PurchasesDefaultAccountCode", "SalesTrackingCategories", "PurchasesTrackingCategories", "PaymentTerms", "ContactGroups", "Website", "BrandingTheme", "BatchPayments", "Discount", "Balances", "HasAttachments"}, {"ContactID", "ContactNumber", "AccountNumber", "ContactStatus", "Name", "FirstName", "LastName", "EmailAddress", "SkypeUserName", "ContactPersons", "BankAccountDetails", "TaxNumber", "AccountsReceivableTaxType", "AccountsPayableTaxType", "Addresses", "Phones", "IsSupplier", "IsCustomer", "DefaultCurrency", "UpdatedDateUTC.1", "XeroNetworkKey", "SalesDefaultAccountCode", "PurchasesDefaultAccountCode", "SalesTrackingCategories", "PurchasesTrackingCategories", "PaymentTerms", "ContactGroups", "Website", "BrandingTheme", "BatchPayments", "Discount", "Balances", "HasAttachments.1"}),
     #"Changed Type1" = Table.TransformColumnTypes(#"Expanded Contact",{{"Date", type datetimezone}}),
     #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"ContactID", "ContactNumber", "AccountNumber", "ContactStatus", "FirstName", "LastName", "EmailAddress", "SkypeUserName", "ContactPersons", "BankAccountDetails", "TaxNumber", "AccountsReceivableTaxType", "AccountsPayableTaxType", "Addresses", "Phones", "IsSupplier", "IsCustomer", "DefaultCurrency", "UpdatedDateUTC.1", "XeroNetworkKey", "SalesDefaultAccountCode", "PurchasesDefaultAccountCode", "SalesTrackingCategories", "PurchasesTrackingCategories", "PaymentTerms", "ContactGroups", "Website", "BrandingTheme", "BatchPayments", "Discount", "Balances", "HasAttachments.1", "Status", "LineAmountTypes", "LineItems", "TotalDiscount", "CurrencyCode", "CurrencyRate", "InvoiceID", "BrandingThemeID", "Url", "SentToContact", "ExpectedPaymentDate", "PlannedPaymentDate", "HasAttachments", "Payments", "CreditNotes", "Prepayments", "Overpayments"}),
     #"Changed Type" = Table.TransformColumnTypes(#"Removed Columns",{{"Date", type date}, {"DueDate", type datetimezone}, {"UpdatedDateUTC", type datetimezone}, {"FullyPaidOnDate", type datetimezone}}),
     #"Merged Queries" = Table.NestedJoin(#"Changed Type",{"Type"},INV_CR,{"Type"},"INV_CR",JoinKind.LeftOuter),
     #"Expanded INV_CR" = Table.ExpandTableColumn(#"Merged Queries", "INV_CR", {"INV_CR"}, {"INV_CR.1"}),
     #"Removed Columns1" = Table.RemoveColumns(#"Expanded INV_CR",{"Type"}),
     #"Renamed Columns" = Table.RenameColumns(#"Removed Columns1",{{"INV_CR.1", "INV_CR"}})
in
     #"Renamed Columns"

I added a INV_CR table to convert Type 0 to CR and 1 to INV.

This is a work in progress, my aim will be to load data to a CosmosDB, and get it all into the cloud. Feel free to get n touch if you have questions about this.

That Power Query should work nicely in Excel as well, so there are a few possibilities here

Analysis and the Design of Computer Systems

Good computer systems don’t just spring up of themselves, they require a lot of work from end users, consumers, managers, analysts, designers, documenters,  developers and testers. These are all roles in the development process, it is not meant to be definitive, a single person may have multiple roles, a single role will often have multiple persons. For small systems a few people may occupy most of the roles, there may be a whole class of roles, such as stakeholders, who intersect other roles. In order to disentangle these roles and relationships and create a good computer system we use analysis.

Analysis is sometimes seen as an optional extra, on small projects where there is a temptation to start first and repent at leisure, on large projects it can get lost in a maze of priorities, lists and milestones, then repentance is less leisurely. Analysis starts with some introspection, and a review of where a project is at and where it is going. A good project is linked to a business initiative, but there can be cases where the computer system itself is the trigger for a remediation of replacement project. A useful ingredient is cost benefit analysis and risk assessment. These activities need to be conducted rigorously to ensure outcomes satisfy user expectations and that risks are acknowledged and ameliorated.

Having attended to the basic prerequisites basic prerequisites of cost and risk, the analyst’s attention must turn to the business domain. The analyst, or the team of analysts, will attempt to decompose the business problem into it’s component parts and interact with subject matter experts and stakeholders. One of the interesting things about subject matters experts is that they exist at all levels of an organization and may rarely get together to share their views, so discovery will be multifaceted at all of, and between organizational levels.

At this point many stakeholders will, no doubt,  keen to see lists of requirements, process models and specifications. The Analysts will be trying to internalize a large quantity of information in order to create a broad brush design of a workable solution to the business problem. These goals and aspirations are not necessarily incompatible with each other, but they may not be naturally compatible.

The initial analysis and design process can be thought of as antithesis, synthesis and thesis. The decomposition of the problem domain is the antithesis, the design process is the synthesis and the design is the thesis. Ensuing iterations of the development process repeat this cycle, which can also be viewed as a continuous process, as synthesis continues until the goals are achieved.

Power BI, the new desktop multi-tool

I’ve been creating short videos for Power BI and Excel users for around a year now, publishing one a month to my You Tube channel. I’m starting to get a feel for what people are looking for in Power BI, and I am surprised. My most recent video Power BI - scraping the web is a real hit! This says to me that not only is Power BI a superb business intelligence tool, it’s also handy for data extraction and manipulation. The other real lesson is that observation of how people approach a new app can indicate areas of potential growth.

Offering more cloud solutions

I’ve been ramping up my BI offering, centered around PowerBI. In order to offer my clients a more complete solution I have become a cloud solution provider (CSP), partnered with rhipe.com.au. This enables me to offer a range of Microsoft products including Office 365, Power Bi Pro and Azure services. I’m still adjusting my offering, but, if it’s Microsoft, I can supply it to you at a reasonable price and offer some excellent support.