Numeric vs String Attributes – which is more efficient?

Introduction

An interesting question was posted on the TM1Forum about the most efficient way to craft a rule. This raised the subsequent question of how TM1 attributes are stored behind the scenes, and the impact of that on performance.

The documentation is vague on this point, and, although the arguments presented in the TM1forum post made sense, there wasn’t a definitive answer.

I thought I’d put it to the test.

The Method

I set up a cube with a large item dimension (4,000 elements) and a measures dimension containing an element for each calculation technique I wanted to test. I then wrote a rule for each measure, using one of the methods suggested in the TM1Forum post, as follows:

  • Measure 1: Used an IF statement to test if the category name ends with a ‘1’ or a ‘2’, and returned 1 if it does.
  • Measure 2: Added a numeric attribute to the category dimension which would contain 1 if the rule should return 1.
  • Measure 3: Added a string attribute to the category dimension which would contain ‘1’ if the rule should return 1.
  • Measure 4: Used the string attribute, but converted it to a numeric value before checking if it was 1 or 0.

I crafted a cube view that contained roll-ups of all the dimensions except the measures. I then calculated the cube view for each measure and timed how long it took to get a result.

I repeated the test three times for each measure, arbitrarily altering the rule and re-saving to ensure TM1 wouldn’t use cached values.

The Results

Interestingly, the test seems to have confirmed the assertion on the TM1 forum post that numeric values are actually stored as strings and converted. Here are the numbers, in seconds and %, for the detail-oriented:

Measure 1

Measure 2

Measure 3

Measure 4

Total

                     39

                     91

                     88

                   108

           326

                     43

                     99

                     97

                   125

           364

                     43

                   100

                     97

                   125

           365

                     42

                     97

                     94

                   119

           352

12%

27%

27%

34%

100%

Note:  the discrepancy between the first test and the subsequent ones can be explained by the fact that my laptop was running on battery for the latter ones.

It is clear that using a simple IF statement, even one containing two SUBST calls in its conditional, is more than double as efficient as using an attribute to determine behaviour. Of course, you get many benefits from using the attribute approach, so in many cases, it is still worth the overhead.

Converting the attribute to its numeric equivalent using NUMBR within your rule is markedly slower than comparing the string without conversion, but there is very little difference between using a string attribute over a numeric one. One is roughly as efficient as the other when reading from the attribute cube.

This means that numeric attributes are indeed most likely stored as strings, but the overhead of the conversion is negligible, and does not operate in the same way as the NUMBR function.

I would guess that internally TM1 skips validation of the string during the conversion, as the UI makes it impossible to enter a non-numeric value into a numeric attribute. The NUMBR function can’t do this, as it can accept any string as input.

I found these results very interesting, and they give us a framework to determine which method is best practice.

Conclusion

So what can we to take away from this small test? Here are a few tips:

  1. Using hard-coded logic is likely to be more efficient. However, hard-coding always goes against maintainability, so only do this if you’re sure the logic will never change, nor will the elements involved! This is a big assumption to make, so be very careful with it! Even when you can be sure, only choose this method if speed is the #1 priority in the model.
  2. When flexibility is needed, use a numeric attribute as a flag to determine rule behaviour. Since there is no significant overhead to using a numeric attribute over a string, the best choice is to go with the numeric. TM1 could one day change the way it stores numeric attributes, which could result in this approach being more efficient than storing at a string. However, it is unlikely that any changes in TM1 will lead to a string attribute becoming more efficient to read than a numeric one.
  3. Never convert your attributes manually using the NUMBR function. There is no benefit to this method, and it is significantly slower, so steer well clear of it.
I hope this article helps you make the right call when writing dynamic rules in the future! Happy modelling!
I’ve attached the model I used for testing, and the spreadsheet containing the results I obtained.

TST Model Data.zip (69.00 kb)

TM1 Attribute Tests.xlsx (10.09 kb)

From Agile to Anarchy (and back again)

Introduction

TM1 development has undergone a subtle evolution over the years.

As a relatively early adopter (I still refer to TM1 as an Applix product occasionally, and I remember the original version of TM1Web) of the technology, I’ve watched this evolution with interest, and feel what I have been doing with Flow, is an attempt to bring that evolution full circle and get back to those early glory days.

In this article, I reminisce, wax lyrical, and take a look at the present and future state of selling and implementing TM1.

Warning: this post may contain heavy doses of nostalgia!

Agile Roots

Anyone else remember a time when the typical TM1 implementation went as follows:

  • Get the client’s general ledger accounts and data
  • Write a few TIs to create the account and cost center structures, and suck in the data
  • Build some Excel reports to show the new data off
  • Hook up a few manual input templates for the tricky stuff
  • Send the users to a TM1 training course
Yes, these were simpler times, times when “Excel on steroids” was the sales pitch and demonstrating the “what-if” feature would get genuine wows from the crowd.
 
We used to sell in a couple of meetings, build POCs in hours, often while the potential client watched, and put together an entire system in weeks rather than months.
 
Perhaps we can remember them fondly, even wistfully. But, sadly, it has been a long time since I was involved in a project that simple, and I believe those kinds of projects are, for the most part, behind us.
 
Now businesses expect a full budgeting and planning application, capable of multiple scenarios and rolling forecasts, and able to collect and collate data from many disparate sources around the globe.
 
TM1 has evolved somewhat to try to meet these needs, but have we evolved as consultants?

Agile Decline

As the Agile methodology became popular in IT and software development projects, those of us in the TM1 sphere were starting to realize we were becoming less and less agile.

I recall speaking on the phone with the owner of a TM1 distributor, discussing the possibility to working with them. This must be two or three years ago now. To my surprise, he started talking about sitting with the customer on a time and materials basis, and building the model with them as they watched and participated.

Of course, I said, “you can’t work like that! We’ve got to lock down the requirements in a formal document, perform a technical design to those specifications, and restrict any modification with a formal change request process!”

It was at that point, in the back of my mind, that it hit me how much TM1 development had changed. The willingness to sit down with a customer, discuss their needs, and build a solution had been replaced with a fearful and almost paranoid IT mentality.

I realized that TM1 modelling and development had become as complex as software development projects, and had evolved to encompass the same rigid processes. The very thing that had originally attracted me to TM1 development — the freedom to build a solution without inflexible requirements — was now gone.

The Problem

So how did we lose the Agile edge that used to define and differentiate TM1 implementations? How did we go from a strong customer focus to formalization, obfuscation and general ass-covering?

The answer is simple. TM1 got bigger — and I’m talking bigger in every way.

Firstly, it was acquired by Cognos, then IBM, and was suddenly thrust into the light of big business. No longer was TM1 the surprising underdog. Now it was expected to go head to head with its enterprise-ready robust big brothers and hold its own.

Concordantly, TM1 started getting larger, more complex implementations. Pre-sales guys who had once gotten away with using the word “scalable” to mean you could add lots of RAM were now being asked if TM1 could be used in a server farm, collecting data from thousands of disparate data sources across global WANs, to calculate an entire organization’s planning, forecasting and consolidation in near real time.

And as a result of all this, we as TM1 implementors got scared. And those of us with an IT background knew exactly what to do: add more layers of process.

However, TM1 did not have the tools to support the Agile processes we were used to following. Deployment was done by manually copying files. Testing was done by manually clicking a mouse. And demonstrations to the customer were performed sparingly, as they took much time to set up and present.

Worst of all, providing any kind of workflow for the customer was embarrassingly lacking. Sure we could fire off external scripts to send out email notifications or SMSes, but the solutions were hardly robust or maintainable.

So we fell back on design and documentation as the crutch to get us through. Write reams of documentation, force the customer to sign off, then quote and build based what was “agreed”.

The fact that describing a financial model in a generic way was often more difficult than building it was neither here nor there.

Reclaiming Agile

Many old-school TM1 implementors have noticed this change, at least on an instinctive level, and tried to develop processes and methods to get back to the old ways. However, most of these were just band-aid solutions, and fell short of tools found in other areas of software development.

Watching this with frustration over the past few years led me to take a step back and look at the bigger picture and think through the problem without letting myself be clouded by prior assumptions.

Flow OLAP is the result those musings, and we hope that our partners are finding value in the tools and applications we’ve released so far.

However, this is just the tip of the iceberg. Keep giving us your support, and we promise to keep innovating until TM1 development has come full circle, and we can reclaim our Agile glory days!

Hey, I warned you about the nostalgia, didn’t I?

Big Data is like teenage sex

There is a saying in the marketing world at the moment and it is quite topical for us as an industry, the saying is:

“Big Data is like teenage sex: everyone talks about it, nobody really knows how to do it, everyone thinks everyone else is doing it, so everyone claims they are doing it.”

I’m not alone in these thoughts other bloggers have discussed this before and it always makes for good reading when someone outside of the business intelligence world discusses what they actually see.

If you have been in and around BI for many years you will remember the transition, the acronyms and the “BI speak” that has constantly been evolving.

Ten years ago very few people in C-level roles had even heard of business intelligence, let alone the term BI, yet we used it . Then there were the cipher codes (acronyms and jargon) we invented by abbreviating all of the terms or inventing new ones. BI we already mentioned, then there was ETL, BRD, TRD, FPM, CPM, Datamart and many others that sometimes we let slip in front of non-technical clients. Added to this there were also the slogans that we liked to impress people with, such as “one version of the truth” or “real time reporting” and even “self-service reporting”

However, Big Data has to be one right up there with the most creative and befuddling of terminologies that has been invented. Think back to the first time you heard the term and what it actually meant to you. I pictured it as the ones and zero’s being far bigger than in normal data, therefore it was a very fat bytes.

I bet many people who read this will recall as much jargon as I have.

So is it technical people who come up with these terms? I doubt that very much, it is undoubtedly us marketing people who invent “sound bytes” that distinguish what we do from the competition. Our industry is not the only one that re-invents terminology, there used to be something called a bureau service and now that is called “in-the-cloud”.

What are the most unusual terms you have heard in the IT world?

Self Service versus Self Destruction

For years we have all known that there are many different parts to the BI jigsaw puzzle. Originally it was quite clear that a finance division was the clear leader when it came to driving a solution for a company. The initial work on these projects produced a static outcome that included information like a general ledger and the accompanying reports they needed. We can even use a uniformed cube for each of these models in todays environment.

The calling for “self-service” reporting, or ad-hoc reports was not as prevalent as it is now. The reason that this did not create too much work for developers was that most accountants had a great knowledge of excel.

The real underlying issue has always been that to be truly gifted in “self-service” reporting you needed to be a “power” user. The number of true business report developers was hampered by this hurdle. However, I don’t believe that this was necessarily a bad thing from a client perspective.

The reason I say that is we have all heard the term “paralysis by analysis” and if you give self-service to everyone that is exactly what you will get.

The loss of man hours due to an employee not being able to undertake their primary work function, due to a desire to create mind numbingly beautiful reports will become horrendous. It is very difficult to see a safe balance if all this coding work is required to be undertaken inside a clients business.

Therefore, offering a client greater freedom to build reports has to be tempered by the fact that some of their staff will always be willing to spend valuable time to build a better report. Clients need to be made aware of the issues that BI products can cause to their human resources and also need to understand that it is far more efficient to allow a dedicated developer to undertake this for them.

Obviously, the argument will be the cost of an external developer to the cost of an internal resource. However, you are not only investing in development expertise, but you are also getting a person with a wide array of similar projects. Thus, an external resource will always have a greater experience base than someone who is restricted to one company. They still will have expertise, however they will miss out on the spectrum of experience that a pure consulting company undertakes.

There is also a great argument for static generic reports that give clients close to a full solution, especially ones that give a little flexibility when it comes to the final offering. So next time a client puts “self-service as their number one aim, just take the time to find out why.

Techniques for Building Generic Models

What is a Generic Model?

Generic modelling has the goal of satisfying customer requirements in way that takes into account future needs and enhancements.

Often while gathering requirements, a BA will focus on the customer’s short term needs without considering wider-reaching goals, enhancements, and ongoing maintenance.

In order to use generic modelling techniques, we need to include as much information as possible in our BRDs and use it to design a system that will be more robust, adaptable, and easier to work with and use in the future.

But wait, I hear you say, customers are all different! In fact, each one demands a completely new implementation from scratch! Well, sure, customers will always tell you that their needs are unique and they do things in unconventional ways, and most of them DO have their quirks.

But at the end of the day financial applications end up as one or more lines in GL, no matter how complex the underlying calculations and logic. Isn’t a version a version? Isn’t a currency a currency? Isn’t a year a year, and a product a product?

Legislation and international business standards drive the types and techniques of financial reporting they are trying to produce, so there is bound to be commonality from one customer to the next, even if they are unaware of it.

The idea is to take this commonality and abstract it using generic modelling concepts, in order to reduce the painful redundancy of starting each development cycle from scratch.

This article focuses on the basic development techniques and disciplines you can use in TM1 design and development that will help you achieve a more generic result.

Benefits of Generic Models

Generic models are characterized by the following beneficial features.

Reusability

Ever feel like you’re writing the same calculation logic over and over again? Well, chances are, you are doing exactly that.

Let’s face it, currency conversion rules, for instance, are always eerily similar each time you do them. Likewise, rules to roll forward opening balances.

And what about cube structures? Have you ever noticed that a Loans module is similar to, say, a Project Capex module? Not exactly the same, but each is a list of repeated payments over time, with various other values calculated from that core structure.

If you build with generic principles, you can easily take your Capex module, copy it, add some measures and adapt the rules to satisfy the requirements of a Loan module. This saves hours of design and development time, and keeps the model consistent and familiar to users.

Adaptability

The more generic a model is, the easier it is to make changes.

For example, if you write generic currency rules for each cube, and even include currency conversion in cubes where the customer has said it is not necessary, it is much easier to support additional currencies if the customer requires them later.

And if you are attempting to take an Agile approach to an implementation, being able to change or update a design quickly, and have development respond, is one of the most valuable abilities you can have.

Maintainability

If a model is designed using generic techniques, it is built from the ground up with maintainability in mind. Your goal here is to allow an administrative user to adapt model behaviour without requiring advanced development skills.

Any rules or processes should remain unchanged, with only the inputs to their calculation logic — be those lookup cubes, attributes, or process parameters — requiring update. This helps the customer maintain their own application, without feeling overly reliant on the original consultants who implemented it.

Deployability

Often you’ll want to change the behaviour of a model from development to staging to production. Generic models only require a data change to update their behaviour, so are much easier to maintain in a multi-tiered deployment scenario.

Reduced Risk

When you reuse the same structures and techniques instead of making code changes to adapt a model’s behaviour, you’re inherently reducing the risk of introducing new bugs into the system. To some extent this also alleviates testing requirements, as you only need to test the reusable portion of the module once.

Downside of Generic Models

Speed/Efficiency

Writing rules or processes in a generic way will inevitably add some degree of overhead to your calculations. This is unavoidable, but can be mitigated with various strategies and intelligent design.

Readability & Handover

Often generic rules and TI processes involve more complex code, with frequent lookups and if statements that can confuse developers who might be new to the project.

Likewise, if a customer wants to hire an in-house developer to maintain the model you’ve built for them, they may have some difficulty understand what was done and why in the original design.

This is why it is important that the code is formatted well and commented with meaningful explanations.

How to Build Generic Models

When all is said and done, building models in a generic way is really just a set of disciplines. You need to discard some of your old habits and begin to think generically with every rule and TI you write!

Use lookup cubes and attributes

Hard-coding is the enemy of generic models. If you have a literal string in your rules or TI, you better be sure the thing that string represents is never going to change!

For instance, imagine you are writing a rule that copies the closing balance of the previous year to the current year. Your first thought might be to write a rule like this:

['Opening Bal', '2014'] = N: DB('This Cube', ...,
    'YTD Dec',
    '2013',
    !This Cube Measure
);

Of course this would work, but why limit it to one year? Use an attribute so you don’t have to write the rule again for next year, like so:

['Opening Bal'] = N: DB('This Cube', ...,
    'YTD Dec',
    ATTRS('Year Dim', !Year Dim, 'Previous Year'),
    !This Cube Measure
);

Looks pretty generic, now. But what if you wanted to take this model and deploy it in Australia? The fiscal year starts in July in Australia, so using ‘YTD Dec’ isn’t going to cut it. Assuming you’re using consolidations to tally up your YTD figures, you can restructure the dimension easily enough, but you need to draw your opening balance from YTD Jun.

Again, we can use a lookup to help:

['Opening Bal'] = N: DB('This Cube', ...,
    DB('Lookup Cube', !Year Dim, 'Fiscal Year End'),
    ATTRS('Year Dim', !Year Dim, 'Previous Year'),
    !This Cube Measure
);

You could take these ideas even further. If you want to explore more specific techniques for supporting flexible time dimensions, check out our previous article “Flow’s Date Lookup cube – Back to the Future!” and its sequel, “Back to the Future, Part II“.

Never depend on a particular structure in code

The problem above arises because we have assumed that our YTD values will be structured in a certain way. To some extent, you can avoid assuming a few fundamentals about your design as you code rules and TI, but you can certainly minimize them.

For instance, what if, instead of changing the structure when we want to set a different end of fiscal year month, we decided to name our month elements generically? If we simply called our months, ‘M00′, ‘M01′, ‘M02′, etc, up to ‘M12′, would we have a more generic result?

Well, yes, we could directly reference ‘M12′ in our opening balance rule, which would be attached to ‘M00′. This would mean we wouldn’t need to adjust our YTD consolidations to accommodate a different fiscal year start month.

Use aliases as display labels

However, the above solution is a little aesthetically ugly and not particularly intuitive!

To solve this, we could add aliases to each of these elements to make the display names fit in with our fiscal year period. When deploying in Australia, we could simply name our ‘M01′ element ‘Jul’ to update the behaviour, and remove the need for the costly lookups. In this way, our consolidations could remain static, and would need to be changed to deploy to a different region.

You can apply this technique to many other dimensions, where you substitute an arbitrary code for the primary element name and use aliases to determine the display value. This can make models that were appropriate for one client more transferable to another, and makes your development more agile should a customer change their naming preferences.

Just make sure you save all your subsets with the display alias turned on, and use those subsets in all your important views!

Use standard time dimensions

There has been much discussion about standard time dimensions in the TM1 community, and it seems not everyone agrees. This is just a matter of emphasis. Some place more emphasis on the browsability of cubes and views, while others seek a more flexible and maintainable approach.

Whichever time dimension structure you choose, it is of great benefit to standardize these across your entire module. Even if your users would like to vary the form in which they input data, you can standardize reporting cubes to ensure users get a consistent view.

Check out our previous article “An Item-based Approach to TM1 Model Design” for more information on standardizing reporting cubes across the entire model.

Use a common dimension order

Likewise, it is preferable to keep the order of dimensions as standard as possible. Some developers like to optimize each cube individually by tweaking the dimension order, but in the age of large amounts of available RAM, I believe it is much more preferable to have a predictable dimension order.

This cuts down development time and removes the need for developers to be constantly opening up cubes or using the DB formula generator to ensure the dimension order is correct. It also makes rules much more readable and assist handover to new developers or on-site admins.

Use parameters & global variables to define the behaviour of TI processes

TI processes are generally purpose-built, especially those generated with the wizard. But if you put in a bit of extra time to write these processes generically, you can often use them on future jobs and will save time overall.

Have a look at the our articles “Array Types in Turbo Integrator” and “Returning values from Turbo Integrator processes”  for techniques and tricks to make processes work in more generic ways.

Use dynamic (MDX) subsets and saved subsets effectively

Well-designed dynamic subsets are a great way to ensure changes in your element names or dimension structures will have a minimal impact on saves views and the reports that are based upon them.

Likewise, saved subsets can be utilized to set values such as current month and year. This way, all you have to do is update the named subset, and all the reports and views based on it will reflect the change.

Try to avoid unnamed subsets as much as possible, as these will just lead to confusion and errors down the road.

Create dynamic reports

This is probably a whole article in itself, but when you are writing Excel-based reports, it’s very easy to create them in such a way that they will break if underlying structures or names change.

Create named lists with SUBNM formulae to ensure rows and columns do not get out of sync. Use dynamic paging techniques to display small subsets of data that the user can scroll through. And finally, judicious use of active forms (yes judicious, as Active Forms can become very cumbersome very quickly if you overuse them!) can keep your reports and templates dynamic and responsive.

There are many other tricks you can use, but the main point is, think through the impact of changes to the underlying model and try to develop strategies to help your reports survive the turmoil!

Conclusion

This article has only scratched the surface of the various ways you can create more generic models, just by adopting a few habits and disciplines in your modelling work.

Sure, there is a bit of extra work up front, but the pay-off is huge, and increases exponentially over time! Each implementation, you’ll add to your bag of tricks, and this will leave you with more time to attend to the finer details and give your customer a higher degree of satisfaction.

Team preparation should be a Methodology

What is team preparation?

Is preparation for your team part of your strategy or is it a tactic that needs to be undertaken everytime you are about to start a project?

I believe it is all about team collaboration which on a macro scale definitely falls under a strategy. So what do I mean by team preparation and collaboration?

Everytime you undertake a project you gain not only valuable experience but methodologies for undertaking other projects. For example, if you undertake a Revenue Model for a finance area, the basic structure is the same for every other similar model at other companies.

 

Preparation is not isolated from Project Management

Thus, if you decide on a generic model for doing the projects you can already utilise standard cubes for every Revenue project, standard processes and objects. In fact the only thing that realistically needs to change is the naming convention for the new cubes and dimensions. To ensure that all of your team benefits from this experience you need to ensure there is some sort of centralised area where you can keep these universal cubes and obviously the documentation that assists them to use these tools.

 

Your Toolbox

If you are a person who is tasked with implementing a particular project, then taking a fully equipped toolbox can certainly reduce time and increase the chance of customer satisfaction. So what do I mean by toolbox?

1. Almost all projects that are undertaken in BI usually end up as a line in the General Ledger somewhere, so always keep in mind that other projects need to dovetail into yours. Thus, things like naming conventions can be critical, so developing a generalised naming convention manual will enable you to quickly and successfully standardise names across a business. Remember that this manual is important to be shown to a client upfront and left on site as part of the documentation, here is an example.

2. The iterative approach really means that you are looking to the client as a member of your team. If that is so, then it is very essential to deploy each iteration as soon as it is complete. There are a number of good processes to aid this practice, such as standardising server infrastructure on each project. Ensure you have three types of servers; Production, Development and Staging. The staging server is used for UAT and thus won’t interfere with your next iteration, as with an Agile approach UAT does not necessarily need to be at the end of the programme. With the three server structure you have three “parallel streams” that can be independent and unreliant on other tasks that are being undertaken.

3. Developing some inhouse software solutions that enable you to deploy iteratives fast and efficiently can be of great value. These are usually developed by people with great experience and enable you to deploy each step as it is complete. With this method, it will also help you to decide which parts of each project are going to be undertaken in each step. Don’t be apprehensive about researching online to see if someone else has already developed the tools you need.

4. Make sure your toolbox includes as much uniform documentation as you possibly can. For example standard BRD’s, UAT Questionnaires and Technical Requirement Documents will save you hours of work for the BA’s and Developers when piecing the project together. Also, many of the projects you undertake will be of a similar nature so having pre-developed cubes for say GL projects (such as Capex, Look-up cubes and Revenue are good examples) and grouping them under different industries will be a godsend. They will help you do speedy and efficient Proof of Concepts and will save you mountains of time with your implementation. If you can find a way to enable  these models to be stored as an object and develop your own or buy tools that allow you to modify them (ie quickly change names), it will ensure you are way ahead of the curve.

The last thing is to ensure you have other tools to enable you to make your solution perfect. Tools that enable you to set-up email notifications, tools like Winmerge for comparing and detecting any changes that have been undertaken and also maybe something like SVN for version control.

 

Conclusion

As you can see a well equipped Toolbox will greatly assist your development team as they will always benefit from all the other projects and experience that the whole company have previously undertaken.

Flow Genesis Terms II – defining Diagnostic Reports, Templates and Deployment Packages

Introduction

Ah, the much-anticipated sequel! Will it exceed the beloved original, like “The Godfather Part II”, or will it be a massive disappointment like “Hannibal”?!

This is a follow-up article to “Flow Genesis Terms I – defining Models and Snapshots“, so please read that article first to get the full perspective.

What is a Diagnostic Report?

The Diagnose tab in Flow Genesis allows you to automatically generate a list of common issues associated with any snapshot you have uploaded. This is a useful check to perform before deployment or UAT, as it can often catch errors that are difficult to detect with the human eye.

You can then save the list into a Diagnostic Report to keep a permanent record of issues found. The file created is referred to as a Diagnostic Report, and contains everything you can see on the screen when you diagnose a snapshot.

Once saved, you can also add Sticky Notes to explain or discuss errors with members of the team. This provides a useful method of collaboration to make sure things are not missed during any particular deployment.

It also provides a way for non-technical team leaders or project managers to verify that no issues exist that have not been sufficiently explained by the developer team.

Note the in the future, we will be adding a feature to export a Diagnostic Report into a more easily-readable issue-list document, so it’s worth saving reports now to take advantage of that additional feature when it becomes available.

What is a Template?

If you’ve ever worked on a multi-country or multi-department roll-out, chances are you’ve already thought about templating without realizing it.

Often when similar models are to be deployed in multiple places, the approach taken is to create one generic template model, then use that as a basis for deployment to the other areas. The generic model can be tested and verified by the customer first, before any area-specific customizations are carried out.

In Genesis, a Template refers to an abstracted Snapshot file which allows users to provide specific customizations for designated objects before deployment.

This is useful in POC development or when starting a project, as it gives you a pre-tested and risk-free starting point for any custom development without locking you into a particular naming standard.

The template file contains all the same data included in the Snapshot, along with instructions on how the template will behave when it is applied.

The output of applying a Template is a new Snapshot containing the customizations specified by the user. This Snapshot can be used to deploy a new server, or to upgrade an existing one with the new names.

We have big plans for the Templating feature of Genesis, including a wizard-based interface for many common customizations beyond naming, so it’s well worth investigating how it can help your business processes now.

What is a Deployment Package?

So you have your model completed, your Templates applied and your Snapshot files created… what next?

That’s where Deployment Packages come in. A Genesis Deployment Package is basically a list of instructions to carry out on a model to convert it from one state of development to another.

More simply put, it stores the differences between two Snapshots so that one can be automatically changed into the other.

The first step toward creating a Deployment Package is to perform a “diff”, or comparison between two Snapshots. Diff is a computing term for an operation that identifies differences between two files, in our case the two Snapshot files.

It is important to note that in almost all cases, the first Snapshot used as the basis for the Deployment Package should be a Snapshot of the server your are deploying to. This is to ensure all the generated instructions are valid for the target server. It is sometimes valid to violate this rule, but make sure you understand exactly what you are doing.

The second Snapshot should be the one that represents the new state of the target server.

So, for instance, if you have completed UAT on a staging server, and would like to deploy changes to production, the first Snapshot should be an up-to-date version of the production server, and the second snapshot should be an up-to-date version of the production server. This would result in a series of instructions that would implement all the recent development on the staging server into the production server.

When exported, Deployment Packages have the file extension .xdpd, which stands for “XML Deployment Package Document”. To perform the deployment, you can load the generated file into the Flow Model Packager.

Conclusion

I know sequels are often more convoluted and confusing that the original, so I guess there is a little “sequelitis” happening here!

Hopefully this gives you a better understanding of the terms and features used in Genesis and how you might apply them to your business. Trust me, once you’ve mastered Diagnosis, Templating and Deployment the Genesis way, you’ll wonder how you ever did without it!

Any questions, feel free to use the comments in this article.

Flow Genesis Terms I – defining Models and Snapshots.

What is a Snapshot?

A snapshot is an XML file that contains information about the structure (metadata) of an OLAP model.

Although it sounds like a simple idea, snapshots can have some very powerful applications. They allow the Flow applications to read and display information about a model without being connected to the TM1 Server via the TM1 API. This means tasks can be carried out “offline”, without the risk of disrupting day-to-day TM1 Server functions.

A snapshot file is also a version. That is to say, it is the model at a specific point in time. This makes tasks such as backup, restore, archiving and version tracking possible, and much easier than they would be with a typical TM1 implementation.

Snapshots have been designed to be OLAP database agnostic, meaning they could potentially also describe an OLAP structure in a product other than TM1. However, Flow’s focus is exclusively on TM1 at present.

When exported to a file, Snapshots have the file extension “.xssd”, which stands for “XML Snapshot Document”.

What is a Model?

It’s tempting to assume the terms Model and Snapshot are interchangeable, but they actually have very specific meanings in Genesis.

A Model is simply a container for one or more Snapshots. In its most common usage, you can think of a Model like a project, with the snapshots it contains being the many versions that the project goes through during the development and production life cycle.

Sometimes you might utilize the Model concept in your own way, and that’s ok. Genesis was designed as a tool that lets you work the way you want without prescribing a rigid methodology.

However, generally, we would recommend using the Category field to collect Models into wider groups, such as customer, department or purpose.

What’s inside a Snapshot?

A snapshot contains XML markup to describe the structure of an OLAP Model. From this information, it is possible to perform various analysis of the server structures, automatically recreate the server from scratch, or update an older server with newer structures and code.

To understand snapshots better, you can open one in a standard text editor and review the markup.

You can see standard XML structures within the file, with each “node” having a simple begin and end tag, with optional attributes. Each node can contain other nodes inside it, as in the following example:

<Node att1="val1" att2="val2">
  <Node att1="val1" att2="val2"></Node>
</Node>

Once you understand the basic XML structure, it becomes possible to decipher the contents of the snapshot file. It can be a little difficult at first, because the markup is designed to be as compact as possible, but let’s review the core elements.

The root node is always Database. Hence, the most simple Snapshot possible would be the following:

<Database ID="1" NM="TM1_Server_Name"></Database>

This simply declares the database with an ID and a Name (NM).

Within a Database, a Snapshot can also include Stats, which are pieces of information about the database, and then any Cubes, Dimensions and ETL Processes it contains.

So equally, the following is also a valid representation of an empty server:

<Database ID="1" NM="TM1_Server_Name">
  <Cubes></Cubes>
  <Dims></Dims>
  <Procs></Procs>
</Database>

Each of the “Cubes”, “Dims” and “Procs” nodes can contain multiple markup descriptions of Cubes, Dimensions and ETL Processes respectively. From this simple structure, we can build up a more complete description of a TM1 server, like so:

<Database ID="1" NM="TM1_Server_Name">
  <Cubes>
    <Cube ID="1" NM="Cube1" DimIDs="1 2 3">...</Cube>
    <Cube ID="2" NM="Cube2" DimIDs="1 2 3">...</Cube>
    <Cube ID="3" NM="Cube3" DimIDs="1 2 3">...</Cube>
    ...
  </Cubes>
  <Dims>
    <Dim ID="1" NM="Dim1">...</Dim>
    <Dim ID="2" NM="Dim2">...</Dim>
    <Dim ID="3" NM="Dim3">...</Dim>
    ...
  </Dims>
  <Procs>
    <Proc ID="1" NM="Proc1">...</Proc>
    <Proc ID="2" NM="Proc2">...</Proc>
    <Proc ID="3" NM="Proc3">...</Proc>
    ...
  </Procs>
</Database>

Note that each object has an ID assigned. This is to make the markup more efficient, so when one object needs to refer to another, it can use it’s ID instead of the full name of the object.

A good example of this is where a Cube defines the Dimensions it contains. This is denoted by a list of IDs of the Dimensions, as opposed to a list of names, which could become quite verbose.

It is beyond the scope of this article to discuss the detailed structures of each object in a Snapshot file, but hopefully this gives you enough of an overview to get a basic understanding of how a Snapshot file works, and what the various terms associated with them mean.

We are currently working on a detailed whitepaper detailing the complete Snapshot format, in the hope it may form the basis of an open standard within the OLAP modelling community.

What does a Snapshot NOT contain?

Snapshot files are data-agnostic, so do not contain any data. The reason for this is both to ensure data security and separation of purpose — it makes sense that the design of a cube should be separate from the data contained within it.

There are already plenty of other formats that can handle data well, such as CSV or Tab Delimited text files. We recommend using those standards to import and export data to and from your TM1 servers.

Hidden control objects (such as TM1 “}ElementAttrbutes” cubes and dimensions) are also excluded, but are represented by more generic XML structures so that the information is preserved in a database-agnostic way.

How can I use a Snapshot?

Once you have developed a TM1 model, you can create a snapshot file using the Flow Model Packager.

Snapshot files can then be uploaded to Flow Genesis to be used as the basis for Exploring, Diagnosing, Templating and Deploying TM1 Models.

You can also save the snapshot files for later use, or archive them. If you require version control, Snapshot files are ideal for adding into a Version Control repository, such as SVN, CVS or Microsoft Visual SourceSafe.

Because Snapshot files are implemented with an open standard, you can also build software to read, write and manipulate Snapshot files.

This opens up a whole wealth of application possibilities, which we hope will lead to some innovative software from the TM1 and wider OLAP developer community.

Conclusion

Hopefully this article will give you an insight into Model and Snapshots, how they are different and how they work within the context of Flow Genesis.

Part II of this article will cover the other file types and standards in Flow Genesis.

Introducing the Flow TM1 Rule Editor by Ricky Marwan.

RuleEditorIcon2We’re proud to announce the Flow TM1 Rule Editor, written and maintained by Ricky Marwan.

The TM1 Rule Editor allows you to edit and save your TM1 rules in an innovative and convenient IDE.

  • Formatting and coloured syntax highlighting make reading and organizing your rules easy.
  • Drag and drop cubes to create DB formulae, or just drag single dimensions to get the bang syntax string.
  • The tool also includes a complete palette of valid TM1 rule functions. Simply drag the function to the rule editor and you’ll get the function string along with parameter hints.

Go here for the download and try it out!

InfoCube Spark – making TM1 server monitoring classy!

Introduction

Today, I spent my time configuring and evaluating Spark Monitor, a new product released by Ben Hill from InfoCube.
I was pleasantly surprised by the simple yet attractive design of the site. Good visual design is something that is often overlooked in this industry, so it’s nice to a see a site that’s clean and functional, without looking plain or ugly.
I checked out the online demo (username: tester, password: abc123) and found there was substance behind the eye candy, so decided to sign up, add my server and see how it all worked.
I thought it well worth covering here, so what follows is a brief description of the service, my experience in setting it up, and a list of gotchas I came across.

What is Spark Monitor?

So what does Spark Monitor actually do for you and your clients?

First up, it gives you a way to constantly monitor your server resources, including hard drive space, memory and CPU usage. Often these benchmarks are the first indicator that something may have gone wrong with a TM1 server, so they can be very useful metrics.

In addition, Spark combines the information from TM1Top into a neat and easy-to-read chart, with a table showing the current threads and users.

There is also a very useful table that shows the most recent TM1 log entries, so you can monitor any Turbo Integrator processes and their return status. You can even perform advanced searches of the log files like you can in TM1 Perspectives.

Spark provides you with all these features in a hosted online environment, so all you need to get started is a web browser. You can even make the stats available to read-only users in your client’s organization.

InfoCube Spark is a hosted-only service at the moment, which keeps things simple, but at the same time might be a problem for highly-secured TM1 servers that can’t get internet access.

How does it work?

Spark Monitor uses a very simple and easy technique to ensure the monitor is constantly displaying up-to-date information.

A Monitoring program is installed on the TM1 server and scheduled to run periodically. This program uses the TM1Top and Windows APIs to gather data about the TM1 server and send it to the Spark web application.

The clever part is that this program pushes all the required server information up to the Spark web application (I assume via a web service), rather than having the web application try to pull data down. This means all you need is a regular out-bound internet connection on your TM1 server, while keeping your TM1 model data and structure secure with your regular firewalls and other protections.

Since Windows Task Scheduler is used to trigger the program to run, you can pretty much schedule it any way you want, to make sure your server is monitored at the frequency you desire.

Setting it up

The instructions for setting up the Spark Monitor are available on the website, but I’ll detail a few gotcha I found here so you don’t fall into the same traps.

Firstly, you need to make sure you register your account with the Spark website and then add a new server. The names you give here are for your own identification purposes only, and do not necessarily need to match the names on the TM1 server (although it would make sense to name them this way).

This will get you an automatically generated “server key” which is the identifier that links the server entry on the Spark web application with the Monitor program installed on the TM1 server.

The Monitor program does not come with an installer, so I simply copied it into the “Program Files (x86)” folder manually. You can pick any location you like, as it will eventually be run automatically by Task Scheduler and you won’t have to worry about it.

If you run the Monitor program once, it will create an empty config.cfg for you, which has the basic settings you need. I found it left out one setting, tm1s_bin, so I had to create that manually in the file. The instructions do a pretty good job of helping you get that set up correctly.

If you create your server instances with the Flow Server Manager, like I do, you’ll need to locate the tm1s.cfg file for use with Spark. To do so, just go to “C:\Users\(your username)\AppData\Local\Flow OLAP Solutions\Flow Server Manager\ServerManagerStore” and search for the correct tm1s.cfg in the sub-folders there.

That reminds me to add a “Open tm1s folder” option in the Server Manager to make this sort of thing easier!

Once you’ve got the config.cfg file set up correctly, you can run the program by double clicking and test the results. If you log in to Spark and see your data, you’ve been successful.

If not, the best way to troubleshoot the problem is to look at the Monitor.log file that gets created in the program folder. That will usually tell you what’s going wrong and give you an idea what is configured incorrectly.

Once the program is running correctly and sending information to the Spark web application, all that’s left to do is schedule the program to run periodically. This is very easy if you follow the screenshots on the help page, but I just need to mention one gotcha which cost me an hour of frustration!

Due to this Microsoft bug (or is it a feature) in Task Scheduler, you need to make sure you don’t include quotes around the “Start In” folder when adding it to Task Scheduler. If you do, you’ll get a very ungraceful failure, with an error code and a help link that goes to a missing Microsoft web page!

My Impressions

This is a very useful tool for TM1 administrators and IT departments, and one which will present well in a sales presentation, especially with a technical or IT audience (assuming you can get internet access during the demo).

The functionality is great, and expanding very quickly, as Ben Hill and his team are working on it actively at the moment.

I got in contact with Ben to discuss the product and give him some feedback. He was very responsive and enthusiastic about the product, and when I pointed out a minor security flaw I found in the system, he had it fixed within minutes.

Next on his to-do list is the ability to create “consultant” accounts, which would allow TM1 partners to create and manage server groupings for multiple customers. This would be a great addition, as the majority of Spark users will probably be TM1 partners or consultants with multiple clients.

At Flow, we applaud Ben Hill and InfoCube for this initiative. It’s great to see other companies giving back to the TM1 community for the greater good of the industry, and will ensure they get our full support.

Feature Requests

To improve the user experience, I had a few items on my feature wish list.

First up, the Monitor program could be improved considerably with the addition of an installer and a configuration UI. This would avoid the need for manually copying files, editing configuration details, and messing around with Task Scheduler. Those gotchas I listed above could all have been avoided with an intuitive setup and configuration application.

It appears to have an “automatic update” application included with it, but I did not test that, as I could not see any instructions for it on the Spark website. It would certainly be nice to have the program automatically update itself if need be.

On the web application side, a few other features would be highly desirable.

A notification system that would email you when certain triggers are met, such as the server disappearing, or memory creeping over a certain % would give the program added depth. If users could subscribe to notifications and even create their own trigger thresholds, all the better.

I would also like the ability to edit server details once they have been added. Right now, if you want to change something, you have to delete the server, then add it again, which means you get a new server key and have to dig into your Monitor config files again.

And last but not least, I’d like to have the ability to make the dashboards refresh on a specified schedule, without having to repeatedly click the browser’s refresh button. Even better, the web application could support dynamic (“ajaxified”) screen refresh, so the charts and other dashboard elements could update without refreshing the entire screen.

Given that the Spark web application already predicts how often your Monitor program is configured to update, I would suspect that this functionality is already in the works.

Conclusion

Minor quibbles aside, the InfoCube Spark Monitor is well worth adding to your TM1 bag of tricks.

It’s a completely free service, so why not take advantage of the value it adds for you and your clients?

I’ll leave you with a few screenshots of the application.

And, as always, happy modelling — or in this case, happy monitoring!