Showing posts with label model. Show all posts
Showing posts with label model. Show all posts

Tuesday, March 20, 2012

Adding the Same Column to a Model More Than One Time

I know that I can add a column to a mining structure and/or model more than once using XMLA. However, I am having a problem doing the same using DMX. I now that DMX does not support data binding and that it relies on the INSERT INTO... construct to essentially map the structure columns to the incoming comluns from the data source. I tried to use "AS" like I would in SQL but it doesn't seem to like it.

Can anyone confirm that this can only be done using XMLA and not DMX? If I am mistaken, it would be greatly appreciated if you could provide an example on how to do this using DMX.

For background on why I would want to add the same column to a model more than once please read this post.

Thanks.

It should be fairly straightforward, is this not working?

CREATE MINING STRUCTURE Foo
(
CustID LONG KEY,
Age LONG CONTINUOUS,
AgeDisc LONG DISCRETIZED)

INSERT INTO Foo(CustID, Age, AgeDisc)
OPENQUERY(MyDataSource,"SELECT CustID, Age, Age as Age2 FROM MyTable")

|||Sorry Jamie. I was actually about to delete the post as I realized my obvious oversight.

Adding the Same Column to a Model More Than One Time

I know that I can add a column to a mining structure and/or model more than once using XMLA. However, I am having a problem doing the same using DMX. I now that DMX does not support data binding and that it relies on the INSERT INTO... construct to essentially map the structure columns to the incoming comluns from the data source. I tried to use "AS" like I would in SQL but it doesn't seem to like it.

Can anyone confirm that this can only be done using XMLA and not DMX? If I am mistaken, it would be greatly appreciated if you could provide an example on how to do this using DMX.

For background on why I would want to add the same column to a model more than once please read this post.

Thanks.

It should be fairly straightforward, is this not working?

CREATE MINING STRUCTURE Foo
(
CustID LONG KEY,
Age LONG CONTINUOUS,
AgeDisc LONG DISCRETIZED)

INSERT INTO Foo(CustID, Age, AgeDisc)
OPENQUERY(MyDataSource,"SELECT CustID, Age, Age as Age2 FROM MyTable")

|||Sorry Jamie. I was actually about to delete the post as I realized my obvious oversight.

Thursday, March 8, 2012

Adding page numbers by using the template "Report Model Project"

Hi,
I'm trying - without results - to introduce pagenumbers in my reports
which are made by using the template "Report Model Project" of Visual
Studio 2005. I'm using SQL Server 2005 Reporting Services. Does anybody
know if this is possible en if so how to do it?
Ren=E9René,
You'll need to add a text box to the page footer then set the Expression of
the textbox to
=Globals!PageNumber
or this type of thing is more friendly:
="Page " + cstr(Globals!PageNumber) + " of " + cstr(Globals!TotalPages)
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||Hello Paul,
Thanks for your solution, but I can not use it. Your solution is OK
when using the template "Report Server Project" and not for the
template "Report Model Project" of Visual Studio 2005 as I'm using. It
looks that for the "Report Model Project" it is impossible to add a
textbox, a header and/or a footer. I think it is impossible to add a
page number. I hope I'm wrong about this.
Ren=E9|||Hi René,
I must be missing something here. The report model projects I've created are
essentially data universes, and contain no reports. However, reports can
subsequently be created which relate to these reports using the Report
Builder - presumably you are referring to these reports? If this is the
case, you can edit the rdl for these reports. It's not nice, but you could
add a pageFooter element at the bottom (before the </Report> element). For a
simple page number it would look something like that below. I'll find out
for you if there is a way this can be done using the BIDS GUI.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
<PageFooter>
<ReportItems>
<Textbox Name="textbox6">
<Left>2.5cm</Left>
<Top>0.25cm</Top>
<rd:DefaultName>textbox6</rd:DefaultName>
<Width>2.53968cm</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Globals!PageNumber</Value>
</Textbox>
</ReportItems>
<Height>0.88492cm</Height>
<PrintOnLastPage>true</PrintOnLastPage>
<PrintOnFirstPage>true</PrintOnFirstPage>
</PageFooter>|||Hello Paul,
It works! Thanks.
After using Report Builder I've opened a XML editor and I've added and
adjusted your code.
Ren=E9|||Good news. Keep an eye on this thread though because I'll update it when I
find out definitively if there is an easier way to achieve this through the
BIDS GUI.
Regards,
Paul Ibison

Adding page numbers by using the template "Report Model Project"

Hi,
I'm trying - without results - to introduce pagenumbers in my reports
which are made by using the template "Report Model Project" of Visual
Studio 2005. I'm using SQL Server 2005 Reporting Services. Does anybody
know if this is possible en if so how to do it?=20
Ren=E9Ren,
You'll need to add a text box to the page footer then set the Expression of
the textbox to
=Globals!PageNumber
or this type of thing is more friendly:
="Page " + cstr(Globals!PageNumber) + " of " + cstr(Globals!TotalPages)
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||Hello Paul,
Thanks for your solution, but I can not use it. Your solution is OK
when using the template "Report Server Project" and not for the
template "Report Model Project" of Visual Studio 2005 as I'm using. It
looks that for the "Report Model Project" it is impossible to add a
textbox, a header and/or a footer. I think it is impossible to add a
page number. I hope I'm wrong about this. =20
Ren=E9|||Hi Ren,
I must be missing something here. The report model projects I've created are
essentially data universes, and contain no reports. However, reports can
subsequently be created which relate to these reports using the Report
Builder - presumably you are referring to these reports? If this is the
case, you can edit the rdl for these reports. It's not nice, but you could
add a pageFooter element at the bottom (before the </Report> element). For a
simple page number it would look something like that below. I'll find out
for you if there is a way this can be done using the BIDS GUI.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
<PageFooter>
<ReportItems>
<Textbox Name="textbox6">
<Left>2.5cm</Left>
<Top>0.25cm</Top>
<rd:DefaultName>textbox6</rd:DefaultName>
<Width>2.53968cm</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Value>=Globals!PageNumber</Value>
</Textbox>
</ReportItems>
<Height>0.88492cm</Height>
<PrintOnLastPage>true</PrintOnLastPage>
<PrintOnFirstPage>true</PrintOnFirstPage>
</PageFooter>|||Hello Paul,
It works! Thanks.
After using Report Builder I've opened a XML editor and I've added and
adjusted your code. =20
Ren=E9|||Good news. Keep an eye on this thread though because I'll update it when I
find out definitively if there is an easier way to achieve this through the
BIDS GUI.
Regards,
Paul Ibison

Friday, February 24, 2012

Adding Entity after model creation

I'm woundering if and how it is possible to add a entity to a report model that is directly associated with a database table after the model has already been created?

Thanks for the help if there is any.

You will need to refresh the Data Source View (.dsv) first to pull in the schema for your new table. You can then right-click on the root node in the Model Designer and choose New->Entity. Set the Binding property of the new entity to the new table.