Showing posts with label amount. Show all posts
Showing posts with label amount. Show all posts

Friday, March 30, 2012

How to format numerics with the sign on the right?

I've got an amount field in a report where I want the values to have the sign
(if negative) on the right. But I also want the numbers to line up properly.
I can't seem to find a way to format this. In Excel, you'd use a format like
#,##0.00_);#,##0.00-. But that does not quite do it in Reporting Services. I
see you can use custom formats and the syntax is similar to Excel but not
quite the same. I tried:
#,##0.00 ;#,##0.00-
but RS seems to ignore the whitespace. I also tried:
#,##0.00' ';#,##0.00-
also to no avail.
Any suggestions?What about using double quotes: " " ?
"virtualfergy" wrote:
> I've got an amount field in a report where I want the values to have the sign
> (if negative) on the right. But I also want the numbers to line up properly.
> I can't seem to find a way to format this. In Excel, you'd use a format like
> #,##0.00_);#,##0.00-. But that does not quite do it in Reporting Services. I
> see you can use custom formats and the syntax is similar to Excel but not
> quite the same. I tried:
> #,##0.00 ;#,##0.00-
> but RS seems to ignore the whitespace. I also tried:
> #,##0.00' ';#,##0.00-
> also to no avail.
> Any suggestions?|||Tried it. No luck I'm afraid. Works the same as single quotes. Any other
advice out there?
"Albert" wrote:
> What about using double quotes: " " ?
> "virtualfergy" wrote:
> > I've got an amount field in a report where I want the values to have the sign
> > (if negative) on the right. But I also want the numbers to line up properly.
> > I can't seem to find a way to format this. In Excel, you'd use a format like
> > #,##0.00_);#,##0.00-. But that does not quite do it in Reporting Services. I
> > see you can use custom formats and the syntax is similar to Excel but not
> > quite the same. I tried:
> >
> > #,##0.00 ;#,##0.00-
> >
> > but RS seems to ignore the whitespace. I also tried:
> >
> > #,##0.00' ';#,##0.00-
> >
> > also to no avail.
> >
> > Any suggestions?

Wednesday, March 21, 2012

How to find the second largest value in a field !

Hi,

i am taking the values from four tables ,

I am showing the Salesman in the descending order. according to their Sale Amount. by displaying in Descending, user can able to view the
salesman who sold for the highest amount.

Now I want to find the second highest Amount in the field.

for the highest and lowest we can use the Max and Min funtion.

for the second highest value, How can I write the query.

I already check the previous forums. But i couldn't get the idea.

Kindly reply me

Thank you very much,
Chock.Originally posted by chock
Hi,

i am taking the values from four tables ,

I am showing the Salesman in the descending order. according to their Sale Amount. by displaying in Descending, user can able to view the
salesman who sold for the highest amount.

Now I want to find the second highest Amount in the field.

for the highest and lowest we can use the Max and Min funtion.

for the second highest value, How can I write the query.

I already check the previous forums. But i couldn't get the idea.

Kindly reply me

Thank you very much,
Chock.
Well one way would be to say: what is the highest value after the highest value has been excluded (if you follow me):

SELECT MAX(amount)
FROM mytab
WHERE amount != (SELECT MAX(amount) FROM mytab);

Of course, you wouldn't want to use this recursive approach to get the 5th highest amount! For that, you could do:

SELECT amount FROM mytab m1
WHERE 4 =
(SELECT COUNT(DISTINCT amount) FROM mytab m2
WHERE m2.amount > m1.amount
);

i.e. get the amount for which there are exactly 4 higher amounts in the table.|||Hi,

You send me two queries, the first query I understand it. But in the second query

SELECT amount FROM mytab m1
WHERE 4 =
(SELECT COUNT(DISTINCT amount) FROM mytab m2
WHERE m2.amount > m1.amount
);
what's m1 and what's m2. In the previous query you didn't use the m1.

Actually Amount is the Field name we are going to compare and select.
and mytab is the Table Name.
I am new to this so I think i need some more o understand. can you please tell about the m1 and m2.

Thank you very much,
Chock.|||Originally posted by chock
Hi,

You send me two queries, the first query I understand it. But in the second query

SELECT amount FROM mytab m1
WHERE 4 =
(SELECT COUNT(DISTINCT amount) FROM mytab m2
WHERE m2.amount > m1.amount
);
what's m1 and what's m2. In the previous query you didn't use the m1.

Actually Amount is the Field name we are going to compare and select.
and mytab is the Table Name.
I am new to this so I think i need some more o understand. can you please tell about the m1 and m2.

Thank you very much,
Chock.
m1 and m2 are "aliases". I made them up, because I wanted to use the same table "mytab" twice in the same query and compare values. Without aliases the query would be:

SELECT amount FROM mytab
WHERE 4 =
(SELECT COUNT(DISTINCT amount) FROM mytab
WHERE mytab.amount > mytab.amount
);

... which will return no data, because the condition "WHERE mytab.amount > mytab.amount" is nonsense. What I want to say is "WHERE mytab.amount (in this subquery) > mytab.amount (in the main query)". Aliases allow you to do that.|||tony, you may have confused the issue by jumping from the second highest to the fifth

here's another way to get the row with the second highest value:select Salesman, SaleAmount
from SalesTable
where SaleAmount =
( select max(SaleAmount)
from SalesTable
where SaleAmount <
( select max(SaleAmount)
from SalesTable
)
)in english, "get the row where the SaleAmount is the highest SaleAmount that is less than the highest overall SaleAmount"

wouldn't want to nest that too deeply, eh

i believe a good optimiser will evaluate the innermost first (it is not correlated), then the next inner, then do a straight retrieval -- i could be wrong, though (it has happened, and optimizer performance is not my long suit)

rudy
http://r937.com

Monday, March 12, 2012

How to find out the job/report that is currently running?

How do I find out the report that is currently being run? I have a scenario where some users run a report without knowing the amount of data that will be pulled by it... In such a case, it bogs down the server and doesn't let me access the Report Manager application.

How can I find out what is the report that is currently being run? I know I can get that information from the Show Jobs link fromm Site Settings in Report Manager. But in this case, I am not even able to login to the Report Manager. The memory (8 gigs) in the app server is fully maxed out and it doesn't log me in to the Report Manger.

I ran a query against the ExecutionLog table in the ReportServer database that logs all the executions. But it looks like the data to this table gets logged only after the report execution is completed. There is no way to tell what is being executed right now. I also checked the table RunningJobs in the ReportServer database, but there are no records in that table.

Can someone help?

Thanks.

can someone help?|||

I am unable to find information on the web related to this. Can someone help?

Thanks for your response.

|||In the ReportServer database there is a RunningJobs table which hold this data.|||I have mentioned in my post that this table did not contain any records when I checked. Any possible scenarios/cases as to when such a thing could occur?

How to find out the job/report that is currently running?

How do I find out the report that is currently being run? I have a scenario where some users run a report without knowing the amount of data that will be pulled by it... In such a case, it bogs down the server and doesn't let me access the Report Manager application.

How can I find out what is the report that is currently being run? I know I can get that information from the Show Jobs link fromm Site Settings in Report Manager. But in this case, I am not even able to login to the Report Manager. The memory (8 gigs) in the app server is fully maxed out and it doesn't log me in to the Report Manger.

I ran a query against the ExecutionLog table in the ReportServer database that logs all the executions. But it looks like the data to this table gets logged only after the report execution is completed. There is no way to tell what is being executed right now. I also checked the table RunningJobs in the ReportServer database, but there are no records in that table.

Can someone help?

Thanks.

can someone help?|||

I am unable to find information on the web related to this. Can someone help?

Thanks for your response.

|||In the ReportServer database there is a RunningJobs table which hold this data.|||I have mentioned in my post that this table did not contain any records when I checked. Any possible scenarios/cases as to when such a thing could occur?

Sunday, February 19, 2012

How to filter results for ''All Periods''?

Hi, all,

How could we filter the results to exclude 'All Periods'? E.g. I would like to see sales amount for year of 2001,2002. etc, and I dont want to see the results retured for 'All Periods', thus how could we achieve this?

Thanks.

With best regards,

Yours sincerely,

Hi, experts,

Anyone of you know the answer? Thanks and I am looking forward to hearing from you shortly.

With best regards,

Yours sincerely,

|||

Hello Helen! I am not sure about your problem but this is what you get if you put years on rows or columns in Proclarity Professional. You do not have to filter on years in order to se the years that you would like.

Simply put the years you would like on rows or columns.

If you slice on years,that is choose one or several members in a dimension as a background dimension i Proclarity,

you can pick the year that you are interested in.

Can you tell more about what you are interested in?

HTH

Thomas Ivarsson

|||

Hi, Thomas,

Thank you very much for that.

What I was wondering is to filter the 'All Periods' in the results returned by SSMS (Management Studio) against the MDX query launched there.

Hope it is clear for your help and advices.

With best regards,

Yours sincerely,

|||

Hello Helen! If you run this MDX on the Adventure Works cube:

Code Snippet

Select {[Date].[Calendar].[Calendar Year].Members} On Columns,

[Product].[Product Categories].[Category].Members On Rows

From [Adventure Works]

Where ([Measures].[Internet Sales Amount]);

Is this what you are looking for?

Kind Regards

Thomas Ivarsson

|||

Hi, Thomas,

Thank you for your help. Yes, that's what I am looking for. And how can we add subtotals for each column and each row to the results returned?

Thanks and I am looking forward to hearing from you.

With best regards,

Yours sincerely,

|||

Hello Helen. In ProClarity Professional 6.3 you have an MDX-editor. I think it is under the meny-view.

Create subtotals in ProClarity and copy & paste that code to Management Studio.

That is a good start.

Regards

Thomas Ivarsson

|||

Hi,Thomas,

Thanks a lot and obviously this is an effective way of doing it.

With best regards,

Yours sincerely,