Parameters in SQL with TI

Post Reply
tkingcka
Posts: 28
Joined: Fri Nov 13, 2009 12:02 pm
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: 2013

Parameters in SQL with TI

Post by tkingcka »

I have been attempting to set up a parameter in SQL with TI via ODBC connectivity. The process was pulling data yesterday evening and the parameter was working fine. I came in this morning and no data is available. I am using to data fields from the ODBC pull: FY_CD and PD_NO. In the where clause I was originally using 2013 and 8, which worked then and still currently works. I replaced the 2013 with '?FY_CD?' abd 8 with '?PD_NO?' because both are strings. Now I have no data and don't understand what could have happened. I have attached copies of the ODBC query and the variables tab for your review. Thanks for any assistance.
Attachments
Parameters in SQL for TI.docx
(95.48 KiB) Downloaded 298 times
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Parameters in SQL with TI

Post by tomok »

Are pFY_CD and pPD_NO defined as strings in your Parameters tab?
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: Parameters in SQL with TI

Post by EvgenyT »

try nesting FY_CD and PD_NO into STR in SQL i.e. STR(FY_CD) as ....
and yes what's your variable type? string?

Usually solves that issue for me.

my 2C :)

P.s. look at this thread:

http://www.tm1forum.com/viewtopic.php?f=3&t=9383

ET
tkingcka
Posts: 28
Joined: Fri Nov 13, 2009 12:02 pm
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: 2013

Re: Parameters in SQL with TI

Post by tkingcka »

Issue resolved by saving the parameters first and then going back and changing the Sql code to reflect the new parameter fields. Thanks for your assistance. I did not realize there was an order of precedence required.
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Parameters in SQL with TI

Post by tomok »

tkingcka wrote:I did not realize there was an order of precedence required.
There isn't. You just defined the parameters incorrectly the first time and didn't know it. When you did it again you fixed your error. You probably left the parameters as values (this is the default setting you get when creating a new parameter) instead of defining them as strings. This is the only way the TI code would save without syntax errors, while at the same time resulting in 0 rows returned when executed.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Post Reply