Select top 1 from ascii datasource

Post Reply
telula
Posts: 99
Joined: Tue Nov 18, 2008 5:40 am

Select top 1 from ascii datasource

Post by telula »

Hello,
I am trying to read the first line of my ascii datasource to pick out parameters to zero out the cube. It's easily done in ODBC Connection where I use Select top 1 from dbo.datasource. How can I do similar for an ascii datasource ?
lotsaram
MVP
Posts: 3702
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Select top 1 from ascii datasource

Post by lotsaram »

ProcessBreak as last line of code on the data tab after reading the 1st record.
(or to break after x rows of data source just initialize a counter on the prolog and increment on the data tab with a check for the counter value in an IF statement enclosing the ProcessBreak.)
telula
Posts: 99
Joined: Tue Nov 18, 2008 5:40 am

Re: Select top 1 from ascii datasource

Post by telula »

So if i put ExecuteProcess('Loading') after the process break,will that work?
User avatar
qml
MVP
Posts: 1096
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: Select top 1 from ascii datasource

Post by qml »

It will if you put that line (ExecuteProcess) in the Epilog.

From the documentation on ProcessBreak:
This function stops processing source data and proceeds to the Epilog portion of a process.
Kamil Arendt
telula
Posts: 99
Joined: Tue Nov 18, 2008 5:40 am

Re: Select top 1 from ascii datasource

Post by telula »

thanks!
Post Reply