Showing posts with label total. Show all posts
Showing posts with label total. Show all posts

Tuesday, March 27, 2012

Can we control the privilege of Drilling down?

How can we control the privilege of Drilling down?

For example:

There are for sale area of a company.

The manager of the company can view the total sale report of whole company, and view the individual sales report of the four area. The sales can view the total sale report of whole company, but they can only drill down the area of himself,they can not drill down the other area .

How can I do that?

Hi,
you can perform check of privilege of drilling down by Code in (ReportProperties).
For example (in Properties):
[Row].Visibility = Code.MyFunction
where MyFunction check if the Current user has necessary privilege to see selected row.

Best Regards

Can we contol the privilege of Drilling down

How can we contol the privilege of Drilling down?
For example:
There are for sale area of a company.
The manager of the company can view the total sale reoprt of whole company,
and view the individual sales report of the four area. The sales can view
the total sale reoprt of whole company, but the can only drill down the area
of themself, they can not drill down the other area .
How can I do that?Can any one help me!
"ad" <ad@.wfes.tcc.edu.tw> ¼¶¼g©ó¶l¥ó·s»D
:O3OBudyXFHA.3040@.TK2MSFTNGP14.phx.gbl...
> How can we contol the privilege of Drilling down?
> For example:
> There are for sale area of a company.
> The manager of the company can view the total sale reoprt of whole
company,
> and view the individual sales report of the four area. The sales can view
> the total sale reoprt of whole company, but the can only drill down the
area
> of themself, they can not drill down the other area .
> How can I do that?
>sql

Thursday, March 22, 2012

Can update accumulate?

I need to write an UPDATE statement that adds to a field from data in
another table. Can someone help? below is sample:
UPDATE TableA
SET Total = Total + TableB.Amount
FROM TableB JOIN TableA ON TableB.EmpNo = TableA.EmpNo
WHERE TableB.PrdYr = 2005
When I do this, it does not add in the incremented Total field and I end up
with the last TableB.Amount value.
Thanks.
David>> I need to write an UPDATE statement that adds to a field from data in
Yes, but you will have to provide sufficient information for others to
understand your problem. Pl. read www.aspfaq.com/5006 and post your DDLs,
sample data & expected results
Anith|||Try this, it will keep a running total in TableA each time the query is
run. If this is going to be run and needs all of the values to start
out 0 (no running total), then remove the 'Total + ' part of the query.
UPDATE TableA
SET Total = Total +
( SELECT ISNULL(SUM(TableB.Amount),0)
FROM TableB
WHERE TableB.PrdYr = 2005
and TableB.EmpNo = TableA.EmpNo
)
Kalvin|||David,
An UPDATE statement will only make one assignment
to each column. UPDATE .. FROM is a T-SQL extension
to standard SQL that allows poorly defined statements, and
while it can be handy, it can also cause confusion. I wish an
error were raised in situations like this, but that's not the case.
To do what you want, you probably need something like
update TableA set
Total = Total + (
select sum(TableB.Amount)
from TableB
where TableB.EmpNo = TableA.EmpNo
and TableB.PrdYr = 2005
)
Steve Kass
Drew University
David wrote:

>I need to write an UPDATE statement that adds to a field from data in
>another table. Can someone help? below is sample:
>UPDATE TableA
>SET Total = Total + TableB.Amount
>FROM TableB JOIN TableA ON TableB.EmpNo = TableA.EmpNo
>WHERE TableB.PrdYr = 2005
>When I do this, it does not add in the incremented Total field and I end up
>with the last TableB.Amount value.
>Thanks.
>David
>
>|||Kalvin caught one thing I didn't. This needs either COALESCE
or a WHERE condition on the update, to avoid NULLing out
Total values when there's no match in TableB. Here's a WHERE
condition that ought to do it.
update TableA set
Total = Total + (
..
)
where exists (
select *
from TableB
where TableB.EmpNo = TableA.EmpNo
and TableB.PrdYr = 2005
and TableB.Amount is not null
)
SK
Steve Kass wrote:
> David,
> An UPDATE statement will only make one assignment
> to each column. UPDATE .. FROM is a T-SQL extension
> to standard SQL that allows poorly defined statements, and
> while it can be handy, it can also cause confusion. I wish an
> error were raised in situations like this, but that's not the case.
> To do what you want, you probably need something like
> update TableA set
> Total = Total + (
> select sum(TableB.Amount)
> from TableB
> where TableB.EmpNo = TableA.EmpNo
> and TableB.PrdYr = 2005
> )
>
> Steve Kass
> Drew University
> David wrote:
>|||1) Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. Sample data is also a good idea, along with clear
specifications.
2) Would you like to learn REAL SQL or only some proprietary kludges
that have unpredicatable results, as you have posted?
Did you actually split out a year as a temporal column'!! Surely not
!
Why don't you know that column and field are **totally** different?
Why don't you know that there is no such thing as a generic, magical
"amount" -- it has to be the amount of something. Have you ever had a
BASIC -- repeat BASIC in capital letters -- data modeling class?
You can probably get enough kludges in a newsgroup to slip past your
boss unitl you get to the next job to screw up them too.
I got an email tonight form a kid who volunteered to do a DB for an
African Relief agency and seriously screwed it up. I got the consult
after things got messed up and I posted this in some newsgroups as an
example. I guess he found me via those postings.
I know his design crippled some children; I am not sure about causing
deaths and a part of me does not want to know. Please care enough not
to do that. To other people. To other people.sql

Can total be moved to top of column rather than bottom

Standard newbie disclaimer: I have searched the archives and this is
my second week with the tool, so my apologies if this is a rather
simple question or I am not asking the question properly.
My team has received a specification for a report where the customers
would like to see column totals at the top of the column, rather than
SSRS's default of bottom. I am new to banded report writing, so I am
hoping this is fairly simple. Using BusinessObjects, I would have
inserted a row at the top of the column and then copied the formula
from the total (or subtotal) line up to the line I had just inserted
(then deleted the row at the bottom).
Is there similar functionality with SRSS?
Kind regards,
Steve HaffnerYes, it is possible.
Option-1: If you want to show the total besides the group name: Ask them to
add the group Header(if not available). besides the group name table cell ,
write a expression like =sum(field!columnname.value)
Option-2: If you want to show the total in top of the group name:
right click on table row(Group row) and click on insert row above. and write
a expression like ="Group Total : " & sum(field!columnname.value)
Regards,
Sriman.
"shaffner" wrote:
> Standard newbie disclaimer: I have searched the archives and this is
> my second week with the tool, so my apologies if this is a rather
> simple question or I am not asking the question properly.
> My team has received a specification for a report where the customers
> would like to see column totals at the top of the column, rather than
> SSRS's default of bottom. I am new to banded report writing, so I am
> hoping this is fairly simple. Using BusinessObjects, I would have
> inserted a row at the top of the column and then copied the formula
> from the total (or subtotal) line up to the line I had just inserted
> (then deleted the row at the bottom).
> Is there similar functionality with SRSS?
> Kind regards,
> Steve Haffner
>|||On Apr 5, 10:48 am, "shaffner" <steve_haff...@.hotmail.com> wrote:
> Standard newbie disclaimer: I have searched the archives and this is
> my second week with the tool, so my apologies if this is a rather
> simple question or I am not asking the question properly.
> My team has received a specification for a report where the customers
> would like to see column totals at the top of the column, rather than
> SSRS's default of bottom. I am new to banded report writing, so I am
> hoping this is fairly simple. Using BusinessObjects, I would have
> inserted a row at the top of the column and then copied the formula
> from the total (or subtotal) line up to the line I had just inserted
> (then deleted the row at the bottom).
> Is there similar functionality with SRSS?
> Kind regards,
> Steve Haffner
This can be done similarly in SSRS. You can either insert a row/group
in the top of a table control and add something like the following as
the expression:
=Sum(Fields!FieldName.Value)
Also, you can do the totaling in the stored procedure/query that is
sourcing the report and just pass it to the report and create a
textbox control at the top of the table control and include it there.
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant