Showing posts with label unit. Show all posts
Showing posts with label unit. Show all posts

Monday, March 26, 2012

How to apply For loop here

Problem Description:

I have 5 fields in my report.
4 string type and 1 Date.
4 String type are : Unit , Periods , Grade and Demand
and 1 is Date

I would like to apply a loop which eventually sum up the value of the last field.
Before I explain it furthur I would like to add that all the string type has
multiple value in it.

Description :

I would like sum up Demand for each Grade per period per Unit.

For Example

Unit 1
Date ( monthly)1
Grade 1
Period 1 Total Demand
Period 2 Total Demand
Period 3 Total Demand

Date2
Grade 2
Period 1 Total Demand
Period 2 Total Demand
Period 3 Total Demand

I think this involves couple of For loops , Sorry but not familier with
Syntax that much.

Thanks

AbhisarDo you want to sum the field Demand which is of String type?|||Yes ,
I want to sum field demand. of string type.
so it looks like.

For loop unit ...select one unit in that string array.
then Start for loop to select the date from the Date array ( which in monthly format)
Then for loop to select the grade (string array)....
and then for each period( 3 in it ) it will show me total demand..

The actual data looks like...

Unit date grade period demand
------------------
ew 333 rrr Day 44
ew 333 rrr Eve 55
ew 333 rrr Night 22
...
...
...
ew 645 rrr Day 43
ew 645 rrr Eve 33
ew 645 rrr Night 21

Like wise
diff date .....

I would like to see

for
unit (ew) date(333) for grade(rrr)
on period (Day) total demand
(Eve) total demand
(Night) Total demand

because there are lot of person works on the same date, same unit, same grade
same three period but different demand.
I want to sum up all the demand and write a summary.

I hope I am able to explain my problem to all of u this time.

Thanks|||You can try this in the formula

numbervar eveCount;
numbervar DayCount;
whilePringtingRecords;
if {period}="Day"
DayCount:=DayCount+tonumber({Demand})
else if {period}="Eve"
EveCount:=EveCount+tonumber({Demand});|||Sorry Guys bot not working at all.

Ok , Let me reframe it to one more example.

there are 5 fields , the values in 4 of the fields are not changing at all , only in the 5th field is changing.
For example

1st field 2nd Field 3rd Field 4rth Field 5th Field

xxx rrrr tttt cccc 33
xxx rrrr tttt cccc 44
xxx rrrr tttt cccc 55

I just want to see

xxx rrrr tttt cccc 132 (total)

just in one line.

any ideas now.

Thanks|||If so, then why dont you try to write a query

Select field1,field2,field3,field4,sum(convert(numeric,field5)) from table group by
field1,field2,field3,field4
and design the report using this query

Wednesday, March 21, 2012

How to add Total to Matrx Column/Row

Hi there,
I have a report with 2 column groupings and 5 row groupings looks like
this:
+Unit
+Time
+Type +Sub_Type +Start +Result +Orig SUM(!Field1.Value)
I want to add "Total" to every column and every row and final total
like this:
+Unit
+Time
+Type +Sub_Type +Start +Result +Orig SUM(!Fieldxx) Total_of_Row
Total_of_Column Total
How can I add a column at the right end and a row at the bottom? What
kind of expression should I use?
Thanks a lot.
HenryHenry,
I'm not sure how far along you are but I found out how to add Row & column
subtotals by accident. In Layout mode, right click your "Row" or "Coumn"
field and select SubTotal. THe problem I am experiencing is you have very
limited control over the style. ie wanting the subtotals to be bolded.
Hope this helps - Glen
"Henry" wrote:
> Hi there,
> I have a report with 2 column groupings and 5 row groupings looks like
> this:
> +Unit
> +Time
> +Type +Sub_Type +Start +Result +Orig SUM(!Field1.Value)
> I want to add "Total" to every column and every row and final total
> like this:
> +Unit
> +Time
> +Type +Sub_Type +Start +Result +Orig SUM(!Fieldxx) Total_of_Row
> Total_of_Column Total
> How can I add a column at the right end and a row at the bottom? What
> kind of expression should I use?
> Thanks a lot.
> Henry
>|||It works well, Thanks a lot.
Henry
"Glen" <Glen@.discussions.microsoft.com> wrote in message news:<27B4E130-0C08-49DA-82B2-8E94B66B0216@.microsoft.com>...
> Henry,
> I'm not sure how far along you are but I found out how to add Row & column
> subtotals by accident. In Layout mode, right click your "Row" or "Coumn"
> field and select SubTotal. THe problem I am experiencing is you have very
> limited control over the style. ie wanting the subtotals to be bolded.
> Hope this helps - Glen
> "Henry" wrote:
> > Hi there,
> >
> > I have a report with 2 column groupings and 5 row groupings looks like
> > this:
> >
> > +Unit
> > +Time
> > +Type +Sub_Type +Start +Result +Orig SUM(!Field1.Value)
> >
> > I want to add "Total" to every column and every row and final total
> > like this:
> >
> > +Unit
> > +Time
> > +Type +Sub_Type +Start +Result +Orig SUM(!Fieldxx) Total_of_Row
> > Total_of_Column Total
> >
> > How can I add a column at the right end and a row at the bottom? What
> > kind of expression should I use?
> > Thanks a lot.
> >
> > Henry
> >