Showing posts with label output. Show all posts
Showing posts with label output. Show all posts

Wednesday, March 28, 2012

Reg: Query Performence

Below query output results time taking very much.

SELECT NON EMPTY

{[Measures].[Score]} ON COLUMNS,

NON EMPTY {

(DESCENDANTS({[Organisation].[Organisation].&[36]},0),

[Question].[Type Id].[Category Id],

[Question].[Type Description].[Category Description],

[Question].[Short Description].[Short Description]

)}

HAVING [Measures].[Points]>0 ON ROWS

FROM (SELECT [Assignment].[Id].&[1] ON COLUMNS

FROM [Sample])

Total 7 dimensions 2 measure groups

Fact Table : 18,000,00 Records

Dimensions: 2000 Records

[Organisation].[Organisation] having 9 levels

like

Level1

Level2

LEVEl3

Is there any solution to improve the query performence.Any steps to inreasing performence of cube. Please help me. this is urgent for me

Could you please rewrite your query in terms of AdventureWorks?

Friday, March 23, 2012

Refining MS ACCESS data to csv file using T-SQL


Hello,

I have a table with these sample data pattern:
Col1 Col2
001 2
002 1
002 2
002 1
003 4
003 4
003 3
003 3
003 5

The expected output in the csv file should be exactly like this:
001,2
002,4
002,
002,
003,19
003,
003,
003,
003,

In the csv file, the number next to the topmost 002 is the sum of the Col2 where Col1
is 002 and the remaining field next to other 002 rows will be blank, the same process repeats for 003 and so on.

Would anyone please help me to make a T-SQL statement for the above requirement? I am using VB codes.

Thanks

k

1. Add an AutoNumber field named as ID to your table;

2. Create the query in Access:

SELECT t1.Col1, t2.sumCol2
FROM yourTable AS t1 LEFT JOIN [SELECT Col1, SUM(Col2) as sumCol2, min(ID) as minID
FROM yourTable Group By Col1]. AS t2 ON (t1.ID=t2.minID) AND (t1.Col1=t2.Col1);

3. Export this query to a csv file from Access.

|||

Thank you very much limno. Your T-SQL code perfectly solved my problem.

k
sql

Tuesday, March 20, 2012

Referencing textbox values in expressions

I have a table displaying output from a query. I have cells "a" and "b"
that contain expressions performing calculations on fields in the query. I
would like to create an expression in cell "c" that performs a calculation
on the values in cells "a" and "b".
I can't seem to figure out how to reference the values of the textboxes in
the table. Even putting something as simple as "=a.text" or "=a.value"
returns an error that "a" is not declared ("a" being the name of the
textbox control).
Considering you need "Fields!" for referencing fields and "Parameters!" for
referencing parameters, I suspect that there is something comparable for
referencing the report controls, but I can't find any references to it in
the Books Online.
Does anyone know if this is possible, and if so how?
Thanks.One thing you might want to consider is adding a field to your dataset. When
you have the list of fields that you would drag and drop from when in the
layout tab, do a right mouse click, add. Pick calculated field. Add the
expressions for cell a and cell b. Now these are considered a field like
anything else. You can now create an expression in c that refers to field a
and field b. I find things more understandable and cleaner. Plus, let's say
you want to do a sum or something else on a grouping. No problem, it is just
a field like any other.
This is not real discoverable but in some situations it really makes things
simplier.
HTH,
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Kursplat" <newsgroup-spam@.microsoft.com> wrote in message
news:%23$H72k1%23FHA.2676@.TK2MSFTNGP10.phx.gbl...
>I have a table displaying output from a query. I have cells "a" and "b"
> that contain expressions performing calculations on fields in the query.
> I
> would like to create an expression in cell "c" that performs a calculation
> on the values in cells "a" and "b".
> I can't seem to figure out how to reference the values of the textboxes in
> the table. Even putting something as simple as "=a.text" or "=a.value"
> returns an error that "a" is not declared ("a" being the name of the
> textbox control).
> Considering you need "Fields!" for referencing fields and "Parameters!"
> for
> referencing parameters, I suspect that there is something comparable for
> referencing the report controls, but I can't find any references to it in
> the Books Online.
> Does anyone know if this is possible, and if so how?
> Thanks.|||I would do that if I could (I've tried), but the expression in the
source textboxes are calling functions in an Assembly, which I've
learned the hard way can't be called from the query (it crashes Visual
Studio every time I try).
So, I'm still looking for a way to have the expression of one textbox in
a table reference the value of another textbox in that table.
Thanks for the suggestion, though.
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in
news:e$iAA91#FHA.952@.TK2MSFTNGP10.phx.gbl:
> One thing you might want to consider is adding a field to your
> dataset. When you have the list of fields that you would drag and drop
> from when in the layout tab, do a right mouse click, add. Pick
> calculated field. Add the expressions for cell a and cell b. Now these
> are considered a field like anything else. You can now create an
> expression in c that refers to field a and field b. I find things more
> understandable and cleaner. Plus, let's say you want to do a sum or
> something else on a grouping. No problem, it is just a field like any
> other.
> This is not real discoverable but in some situations it really makes
> things simplier.
> HTH,
>|||I found it in another post. You use "ReportItems!" to reference the
controls on the report.
Kursplat <newsgroup-spam@.microsoft.com> wrote in news:eHD9dGB$FHA.1028
@.TK2MSFTNGP11.phx.gbl:
> So, I'm still looking for a way to have the expression of one textbox in
> a table reference the value of another textbox in that table.|||Hi Kursplat,
For a workaround, in your query, you can set up the calculations there,
then refer to them in cells a and b in your table. From there, you can add
another cell c, and use the Fields! method to call the values in cells a and
b and manipulate those values as you wish in an expression.
Does that make sense?
Cheers,
Daniel.
"Kursplat" wrote:
> I would do that if I could (I've tried), but the expression in the
> source textboxes are calling functions in an Assembly, which I've
> learned the hard way can't be called from the query (it crashes Visual
> Studio every time I try).
> So, I'm still looking for a way to have the expression of one textbox in
> a table reference the value of another textbox in that table.
> Thanks for the suggestion, though.
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in
> news:e$iAA91#FHA.952@.TK2MSFTNGP10.phx.gbl:
> > One thing you might want to consider is adding a field to your
> > dataset. When you have the list of fields that you would drag and drop
> > from when in the layout tab, do a right mouse click, add. Pick
> > calculated field. Add the expressions for cell a and cell b. Now these
> > are considered a field like anything else. You can now create an
> > expression in c that refers to field a and field b. I find things more
> > understandable and cleaner. Plus, let's say you want to do a sum or
> > something else on a grouping. No problem, it is just a field like any
> > other.
> >
> > This is not real discoverable but in some situations it really makes
> > things simplier.
> >
> > HTH,
> >
> >
>

Wednesday, March 7, 2012

Reducing the PDF File Size

Hi all.

I'm using MS SQL 2000's Reporting Services. Our output PDFs are usually composed of fifteen or more pages. Our file size typically exceeds 2 MB per report, I was testing the report on sample outputs and I was getting around 40kb per chart and each of our pages are typically composed of 2-3 charts.

Is there a tweak that can be applied to reduce the file size of the output pdf?

Thanks,
EdwardDO you have any images rendered into the report ? As the report is based on Adove 4 definitions its limitated to the rendering compressions.

HTH, Jens SUessmeyer.

http://www.sqlserver2005.de|||Yes there are images, from the outputs I've generated that does not include any chart the file size is significantly smaller around 8kb per page. The majority of the file size is made up of the charts themselves.

Are you saying that the file size increase caused by the charts cannot be reduced any further due to rendering compressions?|||I guess this is probably the case. WHich version / SP are you currently running ? Ther ehvae been some iprovements on the Reporting rendering during the history of the Service pack development.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||The version I am currently running on the server is:

8.0.1038.0

What service pack version does this belong to?

Thanks.|||Thats the most recent service pack, its service pack 2. SOrry, but there are no more other tweaks that come in my mind. We once had the problem that images (blobs) from the database weren′t compressed properly, because the rendering mechanism could not handle the images in a right way, this was fixed in a Service Pack (I think is was service pack 2)

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||An issue has been opened for this problem. Please add your vote. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=232211

Reducing the PDF File Size

Hi all.

I'm using MS SQL 2000's Reporting Services. Our output PDFs are usually composed of fifteen or more pages. Our file size typically exceeds 2 MB per report, I was testing the report on sample outputs and I was getting around 40kb per chart and each of our pages are typically composed of 2-3 charts.

Is there a tweak that can be applied to reduce the file size of the output pdf?

Thanks,
EdwardDO you have any images rendered into the report ? As the report is based on Adove 4 definitions its limitated to the rendering compressions.

HTH, Jens SUessmeyer.

http://www.sqlserver2005.de|||Yes there are images, from the outputs I've generated that does not include any chart the file size is significantly smaller around 8kb per page. The majority of the file size is made up of the charts themselves.

Are you saying that the file size increase caused by the charts cannot be reduced any further due to rendering compressions?|||I guess this is probably the case. WHich version / SP are you currently running ? Ther ehvae been some iprovements on the Reporting rendering during the history of the Service pack development.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||The version I am currently running on the server is:

8.0.1038.0

What service pack version does this belong to?

Thanks.|||Thats the most recent service pack, its service pack 2. SOrry, but there are no more other tweaks that come in my mind. We once had the problem that images (blobs) from the database weren′t compressed properly, because the rendering mechanism could not handle the images in a right way, this was fixed in a Service Pack (I think is was service pack 2)

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||An issue has been opened for this problem. Please add your vote. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=232211