Showing posts with label detail. Show all posts
Showing posts with label detail. Show all posts

Thursday, March 29, 2012

count problem

Hi.
I have a table containing two groups and a detail area.
I want to add a counter near the second group area.
It should start from 1 and increment by one as second group value changes.(1, 2, 3, ...)
I tried to use count, countRows .... but they didn't work.
I don't want to learn total count of group value.
How can I do this?

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=489400&SiteID=1

Take a look at this post and see if this can help you out! You may have to make some changes, but this might be a start.

If you think this could help, and are unsure about how you could get it to work I brainstormed along this line...

This assumes that you will be doing all your orderring and selection criteria in your SQL statements.

Select your group into a temporary table counting the "detail" rows (this will be your groups). Then join the temp table into your dataset. If all is orderred properly, you should get a dataset that contains your records and your group number in a column.

Like I said, this is just a brain storm. I believe it would work, I just haven't tried it. I do know that the post I've linked to contains some of my code that I tested and verified to work. I have had others tell me it works for them as well. Let me know what you think, and if you need me to expand upon my brainstorm.

Good Luck!

Curtis

|||I have looked at this link lots of times but it didn't work.
You wrote about temp table method.
How can I create a temp table and how can I use it?|||

I'm working on something similiar right now. I'll have a description and a sample before long, unless someone else beats me to the punch.

Curtis

|||

In the group header, you can use a running value based on the CountDistinct function:

=RunningValue(Fields!Id.Value, CountDistinct, Nothing)

Explanation:
The first argument in the running value should be identical to your grouping expression.
The second argument specifies that the CountDistinct function should be used during the calculation.
The third argument specifies that the running value should never reset in your table. If you want it to reset e.g. based on the outer group scope, then specify the outer group name as "reset"-scope.

-- Robert

|||

RunningValue(Fields!Id.Value, CountDistinct, Nothing)

I tried using this. My situation is, I have groups with sub-groups. Some of my sub-groups are not distinct. So something like this may work if every group is distinct, but how do we take in account non-distinct groups? Changing CountDistinct to Count counts all the detail rows, and that's not what I want. I just want a running count of ALL my sub-groups.

This is why I am going the route that I brain stormed. Unless there is an easier way to do it?

Thanks

Curtis

|||

In that case, you will need to look into the custom aggregation approach, similar to the sample in this blog article: http://blogs.msdn.com/bwelcker/archive/2005/05/10/416306.aspx

-- Robert

|||

Robert Bruckner MSFT wrote:

In the group header, you can use a running value based on the CountDistinct function:

=RunningValue(Fields!Id.Value, CountDistinct, Nothing)

Thanks Robert!
It worked successfully.

Tuesday, March 27, 2012

Count occurence of a word

How can I count the rows in wich a specific word occurs in a field in the
detail row of a report?
Thanks
HThere are at least two approaches that come to my mind.
1. Add a caculated field to your dataset that calls a custom VB function
(either embedded in the report or external) which counts the words per row.
Then use the Sum() function to get the overall total.
2. Add a class-level variable to the report embedded code that keeps a
running total. Call a VB function from the field that needs to be counted.
HTH
--
----
Teo Lachev, MVP, MCSD, MCT
Home page and blog: http://www.prologika.com/
----
"Hennie" <spam_me@.linux.com> wrote in message
news:3F608B1B-5F27-4249-912E-0360B60C93FD@.microsoft.com...
> How can I count the rows in wich a specific word occurs in a field in the
> detail row of a report?
> Thanks
> Hsql

Sunday, March 25, 2012

Count Fonts?

Does anyone know of a way in which colors/fonts can be counted? I have a report with numerous fields in the detail section that have been conditionally formatted & would like to count how many reds/greens/yellows appear.
I am well & truly stumped.When you conditional change the color, add a vlue to to other varialbes to keep track thatsql

Tuesday, March 20, 2012

Could you please advice appropriate license for SQL Enterprise edition 2005

If CPU is Quad core it ‘s count to 4 or 1 license cpu. Could you please advice appropriate license for SQL Enterprise edition 2005 like server detail below. Actually i don't want to buy license per cpu. How many Cal for SQL enterprise 2005 license that bundle within first order SQL Svr Enterprise Edtn 2005 English .

Processor : QUAD Core 3.0GHZ X 2

Number of user : 4

Thank you for advance

The following link should have all the information you're after:

http://www.microsoft.com/sql/howtobuy/default.mspx

HTH!