Showing posts with label queries. Show all posts
Showing posts with label queries. Show all posts

Tuesday, March 20, 2012

creating table when session is invoked

Hi,

When I invoke a session in SQL Server I would to create few temp tables. I have got the queries in a file. Is there any way to invoke these queries (Creating Temp tables) whenever I invoke a session.

Any suggestion/guidence would be greatefully received.

Regards,
SAMThis just smells like a bad idea to me. I don't know of a way to do it with the present generation of SQL Server tools, but I've never really given it any thought.

Can you give me an example of how this would help?

-PatP|||Lets make sure we're all on the same page here. SamCute, can you define what you mean by a "session" in SQL Servers.

Thursday, March 8, 2012

Creating Queries

Is is possible to create a query to do something like
this:
For each "Record" from {SELECT field1 FROM table1}
SELECT * FROM table2
WHERE field2='Record'
next "Record"You can use a cursor to do so, but a regular query joining table1 to
table2 using field1 = field2 is the same thing.
What are you trying to accomplish?
Simon Worth
JLong wrote:
> Is is possible to create a query to do something like
> this:
> For each "Record" from {SELECT field1 FROM table1}
> SELECT * FROM table2
> WHERE field2='Record'
> next "Record"|||I think you mean something like this:
SELECT *
FROM Table2
WHERE EXISTS
(SELECT *
FROM Table1
WHERE Table1.field1 = Table2.field2)
Note that when discussing RDBMSs it's often considered more correct to
use the terms "Row" and "Column" in preference to "Record" and "Field".
Some people quite comfortably use these words interchangeably, while
others attach important conceptual differences to them and insist that
"records" and "fields" have no place in a relational database. If you
don't know or care about the difference then I suggest you make the
effort to use the least controversial terms (Rows and Columns) when
posting, if only in the interests of a quiet life ;-)
David Portas
SQL Server MVP
--|||Thank you David for your comments, I really do care about
RDBMS's terminology. Thank you for your suggestion I
will try it tomorrow morning at work and will let you
know how it turned out. As for Simon's question, I have a
query that return a calculations based on a variable
(row/record), I am running the query on the SQL query
analyzer. I was trying to see if I could pass the record
as a query, so I didn't have to change the value by hand.

>--Original Message--
>I think you mean something like this:
>SELECT *
> FROM Table2
> WHERE EXISTS
> (SELECT *
> FROM Table1
> WHERE Table1.field1 = Table2.field2)
>Note that when discussing RDBMSs it's often considered
more correct to
>use the terms "Row" and "Column" in preference
to "Record" and "Field".
>Some people quite comfortably use these words
interchangeably, while
>others attach important conceptual differences to them
and insist that
>"records" and "fields" have no place in a relational
database. If you
>don't know or care about the difference then I suggest
you make the
>effort to use the least controversial terms (Rows and
Columns) when
>posting, if only in the interests of a quiet life ;-)
>--
>David Portas
>SQL Server MVP
>--
>.
>|||Did my suggestion work? If not and you need more help, please read the
following article which explains the best way to desribe your problem
here.
http://www.aspfaq.com/etiquette.asp?id=5006
David Portas
SQL Server MVP
--|||I'm still having problems. I guess that I need to declare
a variable to hold the rows from the first select query
and then pass it to the second select query to return what
I want. In visual basic, it would be a loop like this
For each row in table1
select * from (select column1 from table2 where
coloum2='row') as table
next row
I don't know how to do it or if it could be done.
Basically you return a column from a table and you pass
every row to another query to perform calculations for
each row.
Any idias?

>--Original Message--
>Did my suggestion work? If not and you need more help,
please read the
>following article which explains the best way to desribe
your problem
>here.
>http://www.aspfaq.com/etiquette.asp?id=5006
>--
>David Portas
>SQL Server MVP
>--
>.
>|||"I'm still having problems" doesn't tell me a thing! Did you try out
the query I posted? Did you get an error message? If the result wasn't
what you expected then what was wrong? The query I posted should do
exactly what you want as I understand it: For each row in Table1 return
the matching rows from Table2 where field2 = field1.
I previously posted an excellent article that explains how to describe
your problem for the group, so please try to follow that advice and
post DDL, sample data and show your required end result. You'll find
you get a helpful answer much quicker that way.
David Portas
SQL Server MVP
--

Wednesday, March 7, 2012

creating Powerpoint presentations (etc) from SS 2000 T-SQL

I have a need to create Powerpoint presentations from T-SQL queries (SS
2000). Contents will involve sharts and tables. Now, I can think of some
crude hacks to accomplish this but I'm looking for the most elegant method
that doesn't require an intranet server (not a possibility at the moment).
So my questions are:
1) What is the best way to do this?
2) How do I make xp_cmdshell transactions run on the client instead of the
server?
Thanks,
Randall ArnoldOops, "sharts" should be "charts".
"Randall Arnold" <randall.nospam.arnold@.nospamnokia.com.> wrote in message
news:3nUmg.32998$_k2.579673@.news2.nokia.com...
>I have a need to create Powerpoint presentations from T-SQL queries (SS
>2000). Contents will involve sharts and tables. Now, I can think of some
>crude hacks to accomplish this but I'm looking for the most elegant method
>that doesn't require an intranet server (not a possibility at the moment).
>So my questions are:
> 1) What is the best way to do this?
> 2) How do I make xp_cmdshell transactions run on the client instead of the
> server?
> Thanks,
> Randall Arnold
>|||I assumed that you were creating 'charts' for attorneys...
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Randall Arnold" <randall.nospam.arnold@.nospamnokia.com.> wrote in message
news:wFUmg.32999$_k2.579608@.news2.nokia.com...
> Oops, "sharts" should be "charts".
> "Randall Arnold" <randall.nospam.arnold@.nospamnokia.com.> wrote in message
> news:3nUmg.32998$_k2.579673@.news2.nokia.com...
>|||Shart is something completely different in this neck of the woods. ;)
Arnie Rowland wrote:
> I assumed that you were creating 'charts' for attorneys...
> --
> Arnie Rowland, YACE*
> "To be successful, your heart must accompany your knowledge."
> *Yet Another certification Exam
>
> "Randall Arnold" <randall.nospam.arnold@.nospamnokia.com.> wrote in message
> news:wFUmg.32999$_k2.579608@.news2.nokia.com...|||Yeah, yeah, yuck it up : P.
But-- no suggestions?
: (
Randall
"PSPDBA" <DissendiumDBA@.gmail.com> wrote in message
news:1151083679.040836.66940@.i40g2000cwc.googlegroups.com...
> Shart is something completely different in this neck of the woods. ;)
> Arnie Rowland wrote:
>|||Why would you not consider SQL Reporting Services?
With SRS you have extensive formatting control over the presentation output.
I assume you mean that you desire to have 'sharts' (couldn't resist) and
tables reflective of data -not DDL or DML.
With SRS the learning curve is relatively short for relatively simple
presentations.
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Randall Arnold" <randall.nospam.arnold@.nospamnokia.com.> wrote in message
news:CkZmg.33001$_k2.579688@.news2.nokia.com...
> Yeah, yeah, yuck it up : P.
> But-- no suggestions?
> : (
> Randall
> "PSPDBA" <DissendiumDBA@.gmail.com> wrote in message
> news:1151083679.040836.66940@.i40g2000cwc.googlegroups.com...
>|||I *have* considered it. I just can't get our IT guys on the ball to respond
to requests about it (services not currently running). In the meantime,
I've got this growing daily demand for reports in a company that lives on
Powerpoint presentations...
Randall Arnold
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:%23WOmwBxlGHA.4772@.TK2MSFTNGP04.phx.gbl...
> Why would you not consider SQL Reporting Services?
> With SRS you have extensive formatting control over the presentation
> output. I assume you mean that you desire to have 'sharts' (couldn't
> resist) and tables reflective of data -not DDL or DML.
> With SRS the learning curve is relatively short for relatively simple
> presentations.
> --
> Arnie Rowland, YACE*
> "To be successful, your heart must accompany your knowledge."
> *Yet Another certification Exam
>
> "Randall Arnold" <randall.nospam.arnold@.nospamnokia.com.> wrote in message
> news:CkZmg.33001$_k2.579688@.news2.nokia.com...
>|||It would seem that if the company 'lives on Powerpoint presentation" then
you would be able to gain significant management support for getting SSRS
installed.
Go around the "IT guys" and directly engage management in asking for the
support tools they need to get their work done.
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Randall Arnold" <randall.nospam.arnold@.nospamnokia.com.> wrote in message
news:wFaog.32765$Nb2.602046@.news1.nokia.com...
>I *have* considered it. I just can't get our IT guys on the ball to
>respond to requests about it (services not currently running). In the
>meantime, I've got this growing daily demand for reports in a company that
>lives on Powerpoint presentations...
> Randall Arnold
> "Arnie Rowland" <arnie@.1568.com> wrote in message
> news:%23WOmwBxlGHA.4772@.TK2MSFTNGP04.phx.gbl...
>|||The problem is that this is an immediate need yet this facility may not be
open much longer. So I'm in a catch-22 where purchases are concerned. I've
been stuck with doing things with free or cheap tools and I'm reaching the
limits of what I can do under that constraint...
Randall
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:uflvIffmGHA.3844@.TK2MSFTNGP04.phx.gbl...
> It would seem that if the company 'lives on Powerpoint presentation" then
> you would be able to gain significant management support for getting SSRS
> installed.
> Go around the "IT guys" and directly engage management in asking for the
> support tools they need to get their work done.
> --
> Arnie Rowland, YACE*
> "To be successful, your heart must accompany your knowledge."
> *Yet Another certification Exam
>
> "Randall Arnold" <randall.nospam.arnold@.nospamnokia.com.> wrote in message
> news:wFaog.32765$Nb2.602046@.news1.nokia.com...
>|||A short term solution would be to use Microsoft Excel as a front end
for your charts, and then use OLE to embed the spreadsheet in the
PowerPoint presentation. Not the most ideal scenario, but might get
you through.
If it were me, based on what you describe, I'd work on the Excel
solution AFTER I blew the dust off my resume. :)
Randall Arnold wrote:
> The problem is that this is an immediate need yet this facility may not be
> open much longer. So I'm in a catch-22 where purchases are concerned. I'
ve
> been stuck with doing things with free or cheap tools and I'm reaching the
> limits of what I can do under that constraint...
> Randall
> "Arnie Rowland" <arnie@.1568.com> wrote in message
> news:uflvIffmGHA.3844@.TK2MSFTNGP04.phx.gbl...

Friday, February 24, 2012

creating more efficient queries

Using SS2000. I see queries created using things like
where ziprequestid = cast(' + @.@.requestid + ' as int)
or
left([prop_mkey2],5) = BranchData.zipCode
or
where branch + left(tblFollowup.prop_mkey2, 5)
in(select distinct cast(branch_new as varchar) + cast(zip as varchar) from
tblZipReassign_New where zipziprequestid = ' + @.@.requestid + '))'
Are using things like "left" and "cast" always going to slow a query down?
Is it always going to be more efficient to say create a column for the
zipcode and populate it and index it instead of using "left([prop_mkey2],5)"
to parse it out of another column?
Thanks,
--
Dan D.This is a complex question, because the answer depends on so many other
factors. It is safe (although not certain) to say that it will never be
slower to replace such complex expressions with simpler, pre-calculated and
indexed values. But whether it will be actually be faster... Well, that
depends on the number of Page reads the query processor needs to do to
perform the query, and the answer to that is extremely complex. For example
in some cases, the optimizer maya decide NOT to use an index, even when one
is available, because, in it's judgement, reading teh table completely (a
table scan) will require fewer Page IOs than traversing the index once for
each of the records in the resultset. This is often the case for querys
which will return a "sizeable" percentage of the entire table. The
percentage threshold where this phenomenom occurs is surprisingly low.
(although it is dependant on the depth (number of levels) in the index, it
can be a s low as 5% of the records in the table.
Another phenomenom is that which occurs when the only fields the query
processor needs to read in order to process the query happen to be in some
index. This si then called a "Covering" index, and it means the processor
only needs to read the index, and not the table itself. This changes what
the optimizer will do as well.
ANyway, your best bet is get a bool on SQL Query Tuning and optimization.
"Dan D." wrote:

> Using SS2000. I see queries created using things like
> where ziprequestid = cast(' + @.@.requestid + ' as int)
> or
> left([prop_mkey2],5) = BranchData.zipCode
> or
> where branch + left(tblFollowup.prop_mkey2, 5)
> in(select distinct cast(branch_new as varchar) + cast(zip as varchar) from
> tblZipReassign_New where zipziprequestid = ' + @.@.requestid + '))'
> Are using things like "left" and "cast" always going to slow a query down?
> Is it always going to be more efficient to say create a column for the
> zipcode and populate it and index it instead of using "left([prop_mkey2],5
)"
> to parse it out of another column?
> Thanks,
> --
> Dan D.|||Thanks CBretana. That helps.
"CBretana" wrote:
> This is a complex question, because the answer depends on so many other
> factors. It is safe (although not certain) to say that it will never be
> slower to replace such complex expressions with simpler, pre-calculated an
d
> indexed values. But whether it will be actually be faster... Well, that
> depends on the number of Page reads the query processor needs to do to
> perform the query, and the answer to that is extremely complex. For examp
le
> in some cases, the optimizer maya decide NOT to use an index, even when on
e
> is available, because, in it's judgement, reading teh table completely (a
> table scan) will require fewer Page IOs than traversing the index once for
> each of the records in the resultset. This is often the case for querys
> which will return a "sizeable" percentage of the entire table. The
> percentage threshold where this phenomenom occurs is surprisingly low.
> (although it is dependant on the depth (number of levels) in the index, it
> can be a s low as 5% of the records in the table.
> Another phenomenom is that which occurs when the only fields the query
> processor needs to read in order to process the query happen to be in som
e
> index. This si then called a "Covering" index, and it means the processor
> only needs to read the index, and not the table itself. This changes wha
t
> the optimizer will do as well.
> ANyway, your best bet is get a bool on SQL Query Tuning and optimization.
> "Dan D." wrote:
>|||yr welcome! IN re-reading what I posted, I realized that I implied but did
not explicitly say, one important thing...
During the first phase of query optimization, (called ANalysis) the query
optimizer searches your query for anything that can be used to reduce the
number of page IOs it must perform. Any clause, or expression, in a where
clause or join condition, that can be used, is called a Search Argument
(SARG). A SARG limits the Page IOs that need to be made when it specifies
anb exact match, a range of values, or a conjunction of two SARGS with an
AND. An individual SARG MUST be a Column variable acting on a constant
expression (or variable that can be resolved to a constant) ANY expression
that has a column value being operated on by a function cannot be a SARG.
i.e,
HireDate > DateAdd(day, -30, getdate()) IS a SARG, but
DateAdd(day, 30 HireDate) > getdate() IS NOT a SARG
in the former, the expression
DateAdd(day, -30, getdate()) will be resolved to a constant, and compared
with the value of the HireDate column. If HireDate is in an index, the index
can be used. In the latter case a Table scan ahs tp be done, because the
query processor has to read every HireDate in the table to perform the
function DateAdd(day, 30 HireDate) on each value.
Hope this helps...
"Dan D." wrote:
> Thanks CBretana. That helps.
> "CBretana" wrote:
>|||That does help. As a general rule I try to get people to store something lik
e
DateAdd(day, -30, getdate()) in a variable and then use the variable in the
query. I didn't know that DateAdd(day, -30, getdate()) could still use the
index if it is in the right place in the query.
Thanks.
"CBretana" wrote:
> yr welcome! IN re-reading what I posted, I realized that I implied but di
d
> not explicitly say, one important thing...
> During the first phase of query optimization, (called ANalysis) the query
> optimizer searches your query for anything that can be used to reduce the
> number of page IOs it must perform. Any clause, or expression, in a where
> clause or join condition, that can be used, is called a Search Argument
> (SARG). A SARG limits the Page IOs that need to be made when it specifies
> anb exact match, a range of values, or a conjunction of two SARGS with an
> AND. An individual SARG MUST be a Column variable acting on a constant
> expression (or variable that can be resolved to a constant) ANY expressio
n
> that has a column value being operated on by a function cannot be a SARG.
> i.e,
> HireDate > DateAdd(day, -30, getdate()) IS a SARG, but
> DateAdd(day, 30 HireDate) > getdate() IS NOT a SARG
> in the former, the expression
> DateAdd(day, -30, getdate()) will be resolved to a constant, and compar
ed
> with the value of the HireDate column. If HireDate is in an index, the ind
ex
> can be used. In the latter case a Table scan ahs tp be done, because the
> query processor has to read every HireDate in the table to perform the
> function DateAdd(day, 30 HireDate) on each value.
> Hope this helps...
> "Dan D." wrote:
>

Friday, February 17, 2012

Creating Dynamic MDX Queries within SQL Server 2005 Reporting Services

Please I need some help urgently, How can I create Dynamic MDX Queries
within SQL Server 2005 Reporting Services to use Parameters created
from SQL Queries Dataset.
I was able to do this in SQL Server 2000 Reporting Services by
replacing MDX Statement (1) with (2) below, but I notice the symbol ="
at the begining of statement (2) is not allowed.
(1)
SELECT NON EMPTY { [Measures].[Expected Gross Ult Premium],
[Measures].[Expected Ultimate Deductions Pct], [Measures].[IELR Pct],
[Measures].[Expected Composite Ratio Pct], [Measures].[Booked Premium],
[Measures].[Booked Deduction Pct], [Measures].[Booked Paid Loss Pct],
[Measures].[Booked Incurred Loss Pct], [Measures].[Booked Composite
Pct], [Measures].[Expected NPV], [Measures].[Expected NPV Pct],
[Measures].[Expected ROE], [Measures].[Allocated Capital],
[Measures].[Booked Tech Margin Inc Cat] } ON COLUMNS ,
NON EMPTY { DESCENDANTS( [Underwriting Year].[Underwriting Year].[All
Underwriting Years], [Underwriting Year].[Underwriting
Year].[Underwriting Year] ) } ON ROWS
FROM [GroupReporting]
WHERE ( [Transaction Original Currency].[Currency].&[85], [Lifetime
Contract].[Lifetime Contract].[Originating Contract
Reference].&[C12664] )
CELL PROPERTIES VALUE, FORMATTED_VALUE, CELL_ORDINAL, ACTION_TYPE
(2)
="SELECT NON EMPTY { [Measures].[Expected Gross Ult Premium],
[Measures].[Expected Ultimate Deductions Pct], [Measures].[IELR Pct],
[Measures].[Expected Composite Ratio Pct], [Measures].[Booked Premium],
[Measures].[Booked Deduction Pct], [Measures].[Booked Paid Loss Pct],
[Measures].[Booked Incurred Loss Pct], [Measures].[Booked Composite
Pct], [Measures].[Expected NPV], [Measures].[Expected NPV Pct],
[Measures].[Expected ROE], [Measures].[Allocated Capital],
[Measures].[Booked Tech Margin Inc Cat] } ON COLUMNS , NON EMPTY {
DESCENDANTS( [Underwriting Year].[Underwriting Year].[All Underwriting
Years], [Underwriting Year].[Underwriting Year].[Underwriting Year] ) }
ON ROWS
FROM [GroupReporting]
WHERE ( [Transaction Original Currency].[Currency].&[" &
Parameters!CurrencyCode.Value & "], [Lifetime Contract].[Lifetime
Contract].[Originating Contract Reference].&[" &
Parameters!MISOriginatingContractID.Value & "] ) CELL PROPERTIES
VALUE, FORMATTED_VALUE, CELL_ORDINAL, FORMAT_STRING"You need to change it to be an expression.
Open the dataset properties window.
Make sure the command type is text,
Click Expression Builder (fx) next to the Query String input box, and then
Enter your expression. You won't be able to execute it anymore in the
dataset window, but it will
execute when you refresh your dataset and go to use it.
<michael.oseni@.aleagroup.com> wrote in message
news:1157464471.474318.252920@.d34g2000cwd.googlegroups.com...
> Please I need some help urgently, How can I create Dynamic MDX Queries
> within SQL Server 2005 Reporting Services to use Parameters created
> from SQL Queries Dataset.
> I was able to do this in SQL Server 2000 Reporting Services by
> replacing MDX Statement (1) with (2) below, but I notice the symbol ="
> at the begining of statement (2) is not allowed.
> (1)
> SELECT NON EMPTY { [Measures].[Expected Gross Ult Premium],
> [Measures].[Expected Ultimate Deductions Pct], [Measures].[IELR Pct],
> [Measures].[Expected Composite Ratio Pct], [Measures].[Booked Premium],
> [Measures].[Booked Deduction Pct], [Measures].[Booked Paid Loss Pct],
> [Measures].[Booked Incurred Loss Pct], [Measures].[Booked Composite
> Pct], [Measures].[Expected NPV], [Measures].[Expected NPV Pct],
> [Measures].[Expected ROE], [Measures].[Allocated Capital],
> [Measures].[Booked Tech Margin Inc Cat] } ON COLUMNS ,
> NON EMPTY { DESCENDANTS( [Underwriting Year].[Underwriting Year].[All
> Underwriting Years], [Underwriting Year].[Underwriting
> Year].[Underwriting Year] ) } ON ROWS
> FROM [GroupReporting]
> WHERE ( [Transaction Original Currency].[Currency].&[85], [Lifetime
> Contract].[Lifetime Contract].[Originating Contract
> Reference].&[C12664] )
> CELL PROPERTIES VALUE, FORMATTED_VALUE, CELL_ORDINAL, ACTION_TYPE
> (2)
> ="SELECT NON EMPTY { [Measures].[Expected Gross Ult Premium],
> [Measures].[Expected Ultimate Deductions Pct], [Measures].[IELR Pct],
> [Measures].[Expected Composite Ratio Pct], [Measures].[Booked Premium],
> [Measures].[Booked Deduction Pct], [Measures].[Booked Paid Loss Pct],
> [Measures].[Booked Incurred Loss Pct], [Measures].[Booked Composite
> Pct], [Measures].[Expected NPV], [Measures].[Expected NPV Pct],
> [Measures].[Expected ROE], [Measures].[Allocated Capital],
> [Measures].[Booked Tech Margin Inc Cat] } ON COLUMNS , NON EMPTY {
> DESCENDANTS( [Underwriting Year].[Underwriting Year].[All Underwriting
> Years], [Underwriting Year].[Underwriting Year].[Underwriting Year] ) }
> ON ROWS
> FROM [GroupReporting]
> WHERE ( [Transaction Original Currency].[Currency].&[" &
> Parameters!CurrencyCode.Value & "], [Lifetime Contract].[Lifetime
> Contract].[Originating Contract Reference].&[" &
> Parameters!MISOriginatingContractID.Value & "] ) CELL PROPERTIES
> VALUE, FORMATTED_VALUE, CELL_ORDINAL, FORMAT_STRING"
>|||Thanks Chris, your below solution works fine.
Chris wrote:
> You need to change it to be an expression.
> Open the dataset properties window.
> Make sure the command type is text,
> Click Expression Builder (fx) next to the Query String input box, and then
> Enter your expression. You won't be able to execute it anymore in the
> dataset window, but it will
> execute when you refresh your dataset and go to use it.
>
> <michael.oseni@.aleagroup.com> wrote in message
> news:1157464471.474318.252920@.d34g2000cwd.googlegroups.com...
> > Please I need some help urgently, How can I create Dynamic MDX Queries
> > within SQL Server 2005 Reporting Services to use Parameters created
> > from SQL Queries Dataset.
> >
> > I was able to do this in SQL Server 2000 Reporting Services by
> > replacing MDX Statement (1) with (2) below, but I notice the symbol ="
> > at the begining of statement (2) is not allowed.
> >
> > (1)
> > SELECT NON EMPTY { [Measures].[Expected Gross Ult Premium],
> > [Measures].[Expected Ultimate Deductions Pct], [Measures].[IELR Pct],
> > [Measures].[Expected Composite Ratio Pct], [Measures].[Booked Premium],
> > [Measures].[Booked Deduction Pct], [Measures].[Booked Paid Loss Pct],
> > [Measures].[Booked Incurred Loss Pct], [Measures].[Booked Composite
> > Pct], [Measures].[Expected NPV], [Measures].[Expected NPV Pct],
> > [Measures].[Expected ROE], [Measures].[Allocated Capital],
> > [Measures].[Booked Tech Margin Inc Cat] } ON COLUMNS ,
> >
> > NON EMPTY { DESCENDANTS( [Underwriting Year].[Underwriting Year].[All
> > Underwriting Years], [Underwriting Year].[Underwriting
> > Year].[Underwriting Year] ) } ON ROWS
> >
> > FROM [GroupReporting]
> >
> > WHERE ( [Transaction Original Currency].[Currency].&[85], [Lifetime
> > Contract].[Lifetime Contract].[Originating Contract
> > Reference].&[C12664] )
> > CELL PROPERTIES VALUE, FORMATTED_VALUE, CELL_ORDINAL, ACTION_TYPE
> >
> > (2)
> > ="SELECT NON EMPTY { [Measures].[Expected Gross Ult Premium],
> > [Measures].[Expected Ultimate Deductions Pct], [Measures].[IELR Pct],
> > [Measures].[Expected Composite Ratio Pct], [Measures].[Booked Premium],
> > [Measures].[Booked Deduction Pct], [Measures].[Booked Paid Loss Pct],
> > [Measures].[Booked Incurred Loss Pct], [Measures].[Booked Composite
> > Pct], [Measures].[Expected NPV], [Measures].[Expected NPV Pct],
> > [Measures].[Expected ROE], [Measures].[Allocated Capital],
> > [Measures].[Booked Tech Margin Inc Cat] } ON COLUMNS , NON EMPTY {
> > DESCENDANTS( [Underwriting Year].[Underwriting Year].[All Underwriting
> > Years], [Underwriting Year].[Underwriting Year].[Underwriting Year] ) }
> > ON ROWS
> > FROM [GroupReporting]
> > WHERE ( [Transaction Original Currency].[Currency].&[" &
> > Parameters!CurrencyCode.Value & "], [Lifetime Contract].[Lifetime
> > Contract].[Originating Contract Reference].&[" &
> > Parameters!MISOriginatingContractID.Value & "] ) CELL PROPERTIES
> > VALUE, FORMATTED_VALUE, CELL_ORDINAL, FORMAT_STRING"
> >