I use a combobox to select value form a query. and make 2 columns in combobox.
the list will be
John 1
David 2
Michael 3
and expect when I selected John, will save 1 to table. but access save 0 to table, and if select David, will save 1. how can I save to Column 2 value to table?
Im trying to figure out an Expression in SSRS.
I have 1000s of account details in a DB.
What i want to do is create a table that gives a count of members in each state like :
State Members
AK 234
AL 654
AR 643
How do i add a subgroup to this expression
=CountDistinct(Fields!Agent_External_ID.Value)
Right now it results in the same person being counted twice as the state is not grouped.
To simplify my need: I am comparing a projected sales number to the budgeted sales number and need to color the Projected amounts as red, black, or green, based on whether they are less, equal, or greater than the corresponding Plan amounts. Essentially my data boils down to
║ Group ║ Amount ║ Type ║
╠═══════╬════════╬═══════════╣
║ 1 ║ .95 ║ Projected ║
║ 2 ║ 0 ║ Projected ║
║ 3 ║ .04 ║ Projected ║
║ 1 ║ 1.3 ║ Plan ║
║ 2 ║ 0 ║ Plan ║
║ 3 ║ .03 ║ Plan ║
My tablix is using a column grouping based on the Type.
I tried the following Expression, but it's giving me Green when it should be Red.
=iif(SUM(Fields!Amount.Value)<SUM(iif(Fields!Type.Value = "Plan",Fields!Amount.Value,0),"Type"),"Red",iif(SUM(Fields!Amount.Value)>SUM(iif(Fields!Type.Value = "Plan",Fields!Amount.Value,0),"Type"),"Green","Black"))
My desired output is the following:
I think it would be easier if you change your query to retrieve the data in a different way. However I'll expose a SSRS and a T-SQL solution:
SSRS Solution:
Add a calculated field to your dataset and concatenate the Group and Type.
=Fields!GroupID.Value & "-" & Fields!AmountType.Value
I am using the data you put in your question in order to recreate your scenario. Supposing you are using a matrix to get the desired output just use this data arrangement:
Now in Amount cell font color property use the following expression:
=IIF(
Fields!AmountType.Value="Projected",
IIF(
Fields!Amount.Value >
Lookup(Fields!Group.Value & "-" & "Plan",Fields!GroupType.Value,Fields!Amount.Value,"DataSet3"),
"Green",
IIF(
Fields!Amount.Value <
Lookup(Fields!Group.Value & "-" & "Plan",Fields!GroupType.Value,Fields!Amount.Value,"DataSet3"),
"Red","Black"
)
),"Black"
)
You have to change Fields!GroupType.Value according to the name you set for the calculated field.
It will preview the following matrix:
This solution will only work if you compare only two different types:
Projected and Plan
T-SQL Solution (recommended):
Change your dataset query to get the data in a proper way to compare it. Based on the table you posted I've used this query.
SELECT
a.GroupID,
a.Amount [Projected],
pl.Amount [Plan]
FROM your_table a
INNER JOIN (SELECT
*
FROM your_table
WHERE AmountType = 'Plan') pl
ON a.GroupID = pl.GroupID
WHERE a.AmountType = 'Projected'
It produces:
Try yourself by this fiddle:
With the T-SQL solution the comparation between plan amount and projected amount is trivial in SSRS.
Let me know if this helps you.
I think your issue is that you are comparing the total of Projected + Plan with Projected so it would always be greater.
=IIF(SUM(IIF(Fields!Type.Value = "Projected", Fields!Amount.Value, 0)) < SUM(IIF(Fields!Type.Value = "Plan",Fields!Amount.Value,0),"Type"), "Red",
IIF(SUM(IIF(Fields!Type.Value = "Projected", Fields!Amount.Value, 0)) > SUM(iif(Fields!Type.Value = "Plan",Fields!Amount.Value,0),"Type"), "Green", "Black"))
I have an SSRS report the links a line item subreport to my main report by an order number. When a customer orders 2 line items, 2 order numbers come in with contact info, etc. In the SSRS report, the order number shows up twice and the multiple line items fall below. What I would like is the 1 order number with the line items following.
As I have it now it looks like:
Order# Contact User
1234 J. Smith JS1
LineItem Qty Order Date
1 3 05/15/2015
2 2 05/15/2015
Order# Contact User
1234 J. Smith JS1
LineItem Qty Order Date
1 3 05/15/2015
2 2 05/15/2015
I tried =Fields!LineItem.Value =PREVIOUS(Fields!LineItem.Value) but because the dup isn't directly previous that didn't work.
But I'd like to have just one single result. Any help would be great.
At the bottom of your design screen should be the Row Groups window. Many times, you will already have a group created. If you right click on it and click the properties it should look something like the image below:
Thanks.
I want to be able to group information (no problem) but be able to show a completely different set of columns when the grouping icon ('+') is selected. For Instance, lets say the top level report is:
DEPARTMENT | MANAGER | BUDGET # | TOTAL SALES
Expand DEPARTMENT and get
MANAGERS | COST CENTER | NUM EMPLOYEES | Q1 SALES | Q2 SALES | Q3 SALES | Q4 SALES | ANNUAL TARGET
and so forth; there could be one or 2 more drill downs each with different columns. Is this possible? Thanks in advance.
First of all, name the textboxes containing the top level items.
If you right click on the group that you want to be toggled by the top level report item and select 'Group properties', you can select visibility and there is an option for 'Display can be toggled by this report item' If you click the dropdown, you should be able to find the names of the textboxes.
Repeat this for each of the groups, and the textboxes that you want to toggle them. 'When the report is initially run' does exactly what it says on the tin, so set it appropriately.