Friday, March 30, 2012
Question about Running Totals in a Matrix
monthly values in the columns of the matrix so that I am displaying Month To
Date (MTD) sales numbers in the data. I would like to use a running total
across months to get a YTD report. I am trying to add a row group to the
matrix and define an expression referencing the RunningValue of the
salesamout field.
I get errors about running values cannot be used in group expressions. How
would I solve this problem?You can use the RunningValue function in matrix headers and in matrix cells
(which seems what you want to achieve), but not in the matrix grouping
expression. Therefore, just use a grouping expression like
=Fields!Month.Value for the column grouping and use a function in the matrix
cell similar to: =RunningValue(Fields!Sales.Value, Sum,
"CategoryYearGrouping") - where CategoryYearGrouping would represent the
parent group of the month grouping. See also:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rscreate/htm/rcr_creating_expressions_v1_5tt1.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Mark" <Mark@.discussions.microsoft.com> wrote in message
news:6B23ECD0-8C7F-4AF1-A414-1A712E686303@.microsoft.com...
> I am having problems specifying a running total within a matrix. I have
> monthly values in the columns of the matrix so that I am displaying Month
To
> Date (MTD) sales numbers in the data. I would like to use a running total
> across months to get a YTD report. I am trying to add a row group to the
> matrix and define an expression referencing the RunningValue of the
> salesamout field.
> I get errors about running values cannot be used in group expressions. How
> would I solve this problem?
Wednesday, March 21, 2012
Question about insert query
Shortly why this works
insert dbo.t_Shopping_cart (Product_code,Name,Price,Group,Quantity,Total)
select Product_code,Name,Price,Group,Quantity=1,Total=1
FROM dbo.t_Product
WHERE Group=6
But this doesn't
insert dbo.t_Shopping_cart (Product_code,Name,Price,Group,Quantity,Total)
select Product_code,Name,Price,Group,Quantity=1,Total=Quantity*Price --this is actually line 4
FROM dbo.t_Product
WHERE Group=6
It gives this error
Msg 207, Level 16, State 1, Line 4
Invalid column name 'Quantity'. It does not help if Quantity*Price is in brackets. Probably a simple thing, but I don't know it. Is it even possible to do this kind of query?
Regards
Leif
Your problem stems from the fact that there is no Quantity field on the Product table.. from the declaration "Total=Quantity*Price" it does not infer the Quantity from the previous "Quantity=1" - it will look for it on the product table.
You already know your Quantity when building your sql, so you need not use the reference, you can simply put the number in.
e.g.
select Product_code,Name,Price,Group,Quantity=1,Total=1*Price
or
select Product_code,Name,Price,Group,Quantity=245,Total=245*Price
Aha. You mean it should be something like
select Product_code,Name,Price,Group,Quantity=@.Quantity,Total=@.Quantity*Price --this is actually line 4
Leif
Tuesday, March 20, 2012
Question about if condition in ReportBuilder
I have a question about table layout report. I want to do that:
I have a table report and on that report i have a Total field of money. And i want to do that if condition on that field, so if the prize is less then 150, the color of the text it should be red otherwise it should be other color. So how can i achieve that. I know that this is possible in Reporting services in Report Designer is like =IIF(field.?.Value<150;"red";"gree")
But if i make that same in report builder, the what it does, it displays not the value in color, but it displays the text "red" od "green".
I will be very happy and gratefull if somebody can help me.
thank you in advance.
Hello,
You need to place your expression in the color property, not the textbox.
=Iif(Fields!?.Value < 150, "Red", "Green")
Jarret
|||Hello,
yes this works in Report designer, when you work on reports RDL, but what if you want to do that in Report Builder?
I know that this work in Color property in report designer. But when you want to make that in Report Builder (the client app od RS), then it just get the word out, it doesn't set the color.
Andrej
|||=IIF(FEILD.TEXTBOX.VALUE < 150,"RED","BLUE"I AM YOGESH FROM HYD IF THIS DOES'NT WORKS JUST CALL ME AT 09391323274 I AM FROM HYDERABAD INDIA