Call us: +1 (716) 989 6531 or email at:

Forecasting Software for sales, demand and call volumes

RSS RSS

Navigation





Search the wiki
»

PoweredBy

Tutorial for Lokad OpenShell

RSS
Products » PowerShell Time-Series Forecasting » Here

Tutorial for Lokad OpenShell

My name is Nick Pasko, I am the developer of Lokad OpenShell, and today I'll explain you the basics of the project. Lokad OpenShell comes in a form of a snap-in library, which uses MS Powershell to access Lokad web server and operate with Lokad data.

First and foremost, we'll have to add the library to the Powershell:
Add-PsSnapin LokadOpenShell

to make sure the snap-in was added, let's check whether the cmdlets are available:
get-command | where-object{$_.PSSnapin -match "LokadOpenShell"}

Now we're ready to play with some business data!

In order to use Lokad webservices, we'll have to set up the authentication data for it:
connect-lokad "myaccount@lokad.com" "mypassword"

the authentication info needed to be provided only once per connect-lokad call. To disconnect from Lokad, simply call:
disconnect-lokad

note that the authentication data will be cleared, thus you'll have to provide it again on next connect-lokad call.

I assume you are familiar with Lokad's data format (TimeSeries, Forecasts etc.). If you are not - please take your time to read the Web Application User Guide and find out the info. First of all, everything we do is related to TimeSeries. In order to add business data, add forecasting task and get a forecast, you have to add a TimeSerie first. add-timeserie

OpenShell will ask for TimeSerie name, so the wise decision will be to provide it. You can do it in a separate line, or you could provide it along with the cmdlet call:
add-timeserie "Some time serie name"

Great, now we have a time serie to play with. Unfortunately, TimeSerie is nothing without the business data stored in it. Let's say we're operating with a "Martian Boots Sales" time serie. Those of you who have browsed "My Data" link on Lokad website, must be familiar with this name already.

So, we're selling Martian Boots to some travellers wishing to visit Mars. People don't like tourists there, so our customers want to look like true Martians, in those stylish leather boots with rich ornaments. However, yesterday the sales were low in the morning:
add-timevalue "Martian Boots Sales" ([DateTime] "29.01.2007 09:00:00 AM") 5

of course, you can simply call
add-timevalue

and provide the data when OpenShell will ask for it. Don't worry, it will. Please note that the time should be provided using your local system's date/time format.

Now, back to our beloved Texas-style Martian Boots.By noon, sales went up, probably because people who have already bought "Trip to Mars" (yet another sample time serie here) are aware of the Martian prejudice towards Earth tourists. Our clerks in Trip to Mars department must have tried really hard to explain it, i suppose. Anyway, the sales went up significally:
add-timevalue "Martian Boots Sales" ([DateTime] "29.01.2007 12:00:00 AM") 500

500 sales in 3 hours. Great! But let's see what happened next? As far as we understand, by the end of day travelers should be back on Earth, and we suppose they'll come and buy a whole lot of Martian Boots as presents to their friends and relatives.
add-timevalue "Martian Boots Sales" ([DateTime] "29.01.2007 18:00:00 AM") 100

wait, 100 sales in 6 hours? What on Earth is happening with those Martian tourists? For a whole month people tended to buy lots of Martian Boots once they were back on Earth! Our "Trip to Mars Sales" have gone up, thus this tendency should also go up quite a bit! Whats' the matter? How should we plan our sales now?

Calm down, Lokad takes many factors into consideration, and the forecast will provide you the precise estimates anyway. Perhaps there's a Martian shop selling "Genuine Martian Boots Made on Mars", located on (you guess!) Mars itself. Or some other factor. Anyway, the forecast will be precise, thanks to the Lokad forecasting technology. Now let us get it!

In order to get the forecast, we'll need to add the forecasting task first. Lokad needs to know what you want to be forecasted - monthly sales? daily sales? maximum daily sales on the first monday of March?
add-forecastingtask "Martian Boots Sales" "Daily Sales" "Sum" "Day"

that's summary daily sales for the next day; "Daily Sales" stands for the task name, "Sum" stands for the data aggregation method, and "Day" stands for the period of time. Now, let's finally get to the forecast itself. Hurrah, eh?
get-forecast "Martian Boots Sales" "Daily Sales"

that's it. Only time serie name and task name. And please don't be frustrated if OpenShell returned an error saying you have to purchase an Enterprise license. That's how it all works - you pay some money and get the valuable info to use in your business. Alas, no free donuts here. However, you should not worry. If getting the forecast is crucial for your business - you can always go to Lokad main site and get the forecast manually.

If you want to get a forecast for, say, total monthly sales - go on and create an appropriate task. Yep, that would be something like:
add-forecastingtask "Martian Boots Sales" "Monthly total" "Sum" "Month"

pretty straightforward, isn't it? That's the way Lokad OpenShell is meant to function. If you need to clear the business data (i.e. TimeValues) - you use clear-timevalues command. If you need to remove a forecasting task - you just type remove-forecastingtask and provide the time-serie name and the task name. There's no need to normalize tripolar modulated splines if all you need is get a clear forecast on a clear business data.

Generally, that's all you need to know to start working with Lokad OpenShell. Take your time to play with it, however you should stay alert it is highly addictive! ;)