TM1 Tutorials.com

Implementing TM1 since 2005

  • Home
  • CubeSpy TM1 Monitor
  • Share Your Knowledge!
RSS
Tag Archives: VBScript

How to Import all Files in a Directory

Posted on October 24, 2011 by Ben Hill
2 Comments

We’ve recently been on a Property Management project using TM1 to deliver a Management, Planning and Reporting Solution. The Client has properties which are managed by an external property manager who produces tenancy schedules and general ledger reports for data consumption.

The Problem:

Every properties reports would come from the external property manager in a different file. Making the process to load these into TM1 only mildly faster than using Excel as a solution.

The Solution:

A small script was developed which lists the files from a given directory into a text file for consumption by a “Master” TI Process which then calls another “Child” TI Process for each file, giving the filename and path as a parameter each time.

The “Master” TI Process’ data source is the generated list of files and in the prolog it would run the script over the provided directory (via a parameter variable). This ensures the list of files is up to date.

The “Child” TI Process dynamically sets the datasource to the filename and path provided as a parameter. As the load is accumulative, the section of the cube (a property specific slice) being loaded needs to be cleared before each load to prevent data doubling up. This was further complicated by the fact that the property could not be determined by the name of the file. The clear out was achieved by reading the first line of the datasource file and retrieving the Property Identifier from it, thus performing the Zero Out in the Metadata Tab.

Download Here: makeListOfFoldersFiles.zip

Script Usage:

*PathToScript*\makeListOfFoldersFiles.vbs "*PathToFolder*" "*PathToOutputTextFile*"

Example:

C:\makeListOfFoldersFiles.vbs "C:\TM1s\PropertyModel\Data Files\Oct 2011\" "C:\TM1s\PropertyModel\Data Files\files.txt"

There is additional scripting required when then using this within a TI Process:

Executing the Script from a TI Process: (Prolog)

sExec = 'CScript  D:\blat\full\makeListOfFoldersFiles.vbs "' | pFolder | '" "C:\TM1s\PropertyModel\Data Files\files.txt"';
EXECUTECOMMAND(sExec,1);

This will execute the Script listing the files held within the folder path stored in the parameter variable “pFolder” and write this list to the specified path, which is also the datasource path for this process. Within the Data Tab of the process the “Child” process is called using the “EXECUTEPROCESS” function passing the filename as a parameter. Lastly the “DataSourceNameForServer” Local variable is used within the prolog of the “Child” Process to set the given filename as the datasource to be imported.

Categories: IBM Cognos TM1 | Tags: ExecuteCommand, ExecuteProcess, IBM Cognos TM1, TI Process, TurboIntegrator, VBScript

Sending Emails from TM1 (Part 1: Plain Text)

Posted on October 6, 2011 by David Payten
No Comments

 

Sending Emails from TM1 – Using HTML

Problem:

Although some additional components of TM1 have built-in email functionality, TM1 does not have email functionality built into its ETL Engine.

Solution Process:

  1. Within a TI Process output text to a file to be used as the body of the email to be sent.
  2. Execute an email script command to send off the email to recipients.

Executing the TI script:

The TM1 Email TurboIntegrator Process is parameter driven and will prompt you for parameters to be pushed into the TI process:

  • pRecipient : yourName@yourCompany.com.au ; nextName@yourCompany.com.au ( note use a  semi column between each email address when emailing multiple users.
  • pSubject:  add a comment.
  • pBody: add a comment .
  • pAttachFile: file location of where your file attachment resides.

Email script global variables will need changing before execution of script:

  • sFileName: file location of generated txt file used as the body of the email to be sent.
  • sSender: notifications@yourCompany.com.au ( who the email is from)
  • sSMTPSvr: SMTP or Exchange Server used for emailing. This is often SMTP.yourCompany.com.au ( SMTP server )

Solution: TM1EmailHtml

Notes:

  • Due to 255 character limit restriction within TM1 (prior to version 9.4), instead of emailing individuals you should set up a email group instead of separating each email address separately i.e. use emailGroup@yourCompany.com.au instead of “yourName@yourCompany.com.au ; nextName@yourCompany.com.au”.

In the next post we will show you a practical use for this TI Process: How to send HTML Formatted emails which notify the recipient of nightly minor errors from scheduled chores if/when they occur.

Categories: IBM Cognos TM1 | Tags: Email Alerts, Email Notifications, IBM Cognos, TI Email, TI Process, TM1, Turbo Integrator, VBScript, VBScript Email
  • Authors Profiles

    Regular Authors:







    Guest Authors:
  • TM1 Tutorials Pages

    • CubeSpy TM1 Monitor
    • Share Your Knowledge!
  • Recent Posts

    • InfoCube Spark – An Introduction
    • Woohoo! TM1 Tuts has cracked 100,000 visits!
    • Your Lifeline, The TM1 Transaction Log
    • Creating basic Top 10 reports using MDX expression
    • How to write easily understood Turbo Integrator code
    • Broken Transaction Log?
    • Removing old TM1 Servers from “Services”
    • Turbo Integrator Syntax Highlighter (Notepad++)
    • Messaging users of IBM Cognos TM1
    • Back to Basics – Regions in Rules
    • Cognos Insight – Aligning using the Grid
    • Automating Data Transfers between TM1 Servers
    • TM1 10.1 – IBM Cognos Insight Review Pt 2
    • The [Black Box] Killer
    • Free Trial of Cognos Insight – Big Data Analytics
  • TM1 Tutorials Links

    • Analytics Zone for all things about Cognos Insight and a free trial version.
    • InfoCube Premier Management Consulting on Cognos Products
    • Report Ready – and Waiting! Report Distribution Management – Track PDF Report Consumption by Channel
    • TM1 Networking – Sydney Meetup The meetup group for TM1 in Sydney, Australia
    • TM1 Tutorials on LinkedIn
    • TM1 Tutorials on Twitter Us on Twitter!
    • TM1 Tutorials.com Our primary home on the interwebs
  • Twitter Roll

    • 4 June Meet Up: find out TM1 Developers Guide to Cognos Express http://t.co/3gnjiWAfaQ 1 day ago
    • TM1 Meet Up 4 June we will discuss TM1 Developers Guide to Cognos Express - what you don't know that you should: http://t.co/rGf4BvGnqp 1 day ago
    • Proud to Introduce Spark - a FREE TM1 Monitoring Suite in the Cloud! http://t.co/m6oRSCCmDS 1 day ago
    • TM1 Get Together, anyone who has a passion for IBM Cognos TM1 solutions is welcome! RSVP today. http://t.co/cO4sXXhh3F 1 week ago
    • RT @Mbs_craig: Craig's MBS Daily is out! http://t.co/1LaEhUcup3 ▸ Top stories today via @IBMBAEdu 3 weeks ago
  • Tags

    Active Form Analysis Assistance Big Data Budgeting Cognos Cognos Insight Cognos TM1 Comparative Analysis Corporate Planning CubeSpy Dashboard dynamic reporting ETL Excel ExecuteProcess IBM Cognos IBM Cognos Express IBM Cognos Insight IBM Cognos TM1 Implementing TM1 Installation Guide MDX NT Service Profit & Loss Profitability Analysis Server Monitor Statement of Work TI Process TM1 TM1 10.1 TM1 Consultants TM1 Cube Rules TM1 Development TM1 Installation TM1 Server TM1 Software TM1 Training TM1 Tutorial TM1 Web Transaction Log TurboIntegrator Turbo Integrator VBScript Wim Gielis
© TM1 Tutorials.com. Proudly Powered by WordPress | Nest Theme by YChong