I have an SSRS report with several levels of drilling down. Data is aggregated up for the top level view, but I need to show a different drill down report depending on the type of one of the columns.
Eg:
Table 1 - Apples
Name Cost
Fuji 1.5
Gala 3.5
Table 2 - Squashes
Name Cost
Pumpkin 2
Gourd 4.5
I have a stored procedure which aggregates these and puts them in a table for the top level report to show. Ie:
Name Cost ItemType
Apples 5 1
Squashes 6.5 2
In reality, the two tables have different columns which I need to show in the drill through reports. Is it possible to look at the ItemType column and either drill down to one of two sub-reports, depending on it's value?
If you need to choose between two or more different sub-reports then make the ReportName property of the action on the textbox an expression like this.
=IIF(Fields!ItemType.Value = 1, "subReport_Apples", "subReport_Oranges")
if you have more than a handful SWITCH will probably be better
= SWITCH (
Fields!ItemType.Value = 1, "subReport_Apples",
Fields!ItemType.Value = 2, "subReport_Oranges",
Fields!ItemType.Value = 3, "subReport_Lemons",
True, "subReport_AnythingElse"
)
If you have a LOT of item types, consider adding the names of the subreports to your database creating a new table containing ItemType and subReportName. You can then join to this in your query and get the actual subreport name. The ReportName property of the text action would then simply be Fields!SubReportname.Value
You can add the ItemType as a parameter in your subreport(s). Then from your main report just link or jump to the sub report and pass along the Fields!ItemType.Value in the parameter configuration tab.
Related
I have a key column in two many to many related table and sample representation of data is -
(attaching sample version of the table to get the point across as there are other numerous columns not contributing to this visual)
table 1 -
table 2 -
I am making a line graph with date on x axis and the value1 and value 2 on y-axis. The value1 is true for all dates. It is basically a standard target value. Now I want all the value1 summed up to show in my visual as value1 and not just the ones for which I have data on those dates. To explain it better I want 1717 on the graph as well like the total in the table in the following image -
visual -
Is there a way to do this in power BI? I tried to make a shared dimension of all unique key as a separate table and connecting both the tables to that table but there is no change in visual due to that.
You can follow these below steps to achieve your required output-
Step-1 Create a custom column in your *table 1 as below-
value_1_sum =
CALCULATE(
SUM(table_2[value1]),
ALL(table_2)
)
Step-2 Configure your line chart as below. Remember, the aggregation for new custom column will be Average as shown in the image
And here below is the final output-
Additional Reference Here below is list of options you will get after right click on the measure name-
I've built an SSRS Report with a series of parameters and data sets a user specifies a season (first parameter). There are several data sets -- see below.
The first is a procedure: called LRP_Weekly_Stats returns 9 fields (including, location, eventdata, option, season, and a few others.
The second data set pulls - all the distinct seasons from a view - that gets sent to the parameter drop down. select distinct season from myview it shows/returns just season.
2 additional data set exists it reads
select distinct location from myview where my season = parameter season
and
select distinct option from myview where my season = parameter season
each of these data sets return location and option respectively.
We can't build this as 1 single data set because each of the 5 locations has each of the 4 options associated with and the data being returned gets multiplied by itself.
Data in my view looks like this
Location option
-------------------------
Location1 option1
Location1 option2
Location1 option3
Location1 option4
Location1 option5
Location2 option1
Location2 option2
Location2 option3
Location2 option4
Location3 option1
Location3 option2
Location3 option4
Location3 option5
etc.
In order for the parameters to show each location once and each option 1 for the parameter drop down we do two separate queries.
I didn't build the view and can't adjust it and even if i could the data is such that each location can have each option.
so my two data sets each return the distinct list of possible locations and/or options by season.
in the parameters in the SSRS report the set up looks like this:
so the data coming in to my parameter is pulled from my data set. for each of the three parameters. location and option_1 and option_2. The code itself runs in under 5 seconds however because of all this linkage it takes a good 30+ minutes to run the report. This is completely unacceptable (and I can't remove the drop down data because the users need it).
Any advice about how to streamline this or make it more efficient. Please help.
Based on your reply in the comments on your initial question, it looks to me like the issue is either in the report procedure itself, or possibly a rendering issue. I would look at performance tuning the main report queries. And I'm afraid I can't be more specific than that without knowing a lot more details about your report's architecture.
I laid out the report, and I do a query that returns 30+ rows for a given period of time. One for each workflow. Now, I want to take that dataset (so the query only runs once) and define 6 datasets from it that filter it based on a single selected row. I will populate 8 boxes on the form for each of those datasets.
It appears that when you create a new dataset, it wants to go back to the datasource and ask you about all the data from that one again.
I was able to create a dataset that is a filtered view of the query and figured I could live with creating 6 datasets that ran the query each time filtering it differently each time. So, I need to do a 'copy' on the dataset and 'paste' it back in as a new dataset that is the same as the other one except with a new name.
I also need to set the default values for the Start/End date to be the 1st of last quarter, and the first day of this quarter. Is there a way to create calculated default values or do I need to do a query to return that?
if you are using table objects to create your report. you could use just 1 data set and add your filters to the table accordingly. just go to tablix properties>> filters tab.
for default values you can create expressions like for the first day of the current quarter:
=switch(DatePart(DateInterval.Quarter,today()) = 1, cstr(year(today))+"-01-01",
DatePart(DateInterval.Quarter,today()) = 2, cstr(year(today))+"-04-01",
DatePart(DateInterval.Quarter,today()) = 3, cstr(year(today))+"-07-01",
DatePart(DateInterval.Quarter,today()) = 4, cstr(year(today))+"-10-01")
I have a following employee table value as below :
name | cost
john | 1000
john | -1000
john | 5000
when we add the cost column total will be 5000.
I need to print only the 3rd row in BIRT report, since the 1st and 2nd row get cancelled out each other.
I'm stuck at filtering the table for above scenario.
Couldn't you just solve this using SQL like
select name, sum(cost)
from employee
group by name
order by name
?
Or do you just want to exclude two rows if they have exactly the same cost, but with different signs? Note that this is actually something different, take for example the three rows [ john|1, john|2, john|-3 ]? In this case, a pure SQL solution can be achieved using the SQL analytic functions (at least if you are using Oracle).
Elaborate your question. Its not clear if these are columns or rows.
If These are columns:
Create a computed column in your dataset
In Expression builder of that column add/sub values using dataSetRow['col1'] and dataSetRow['col2']
Add only that computed column to your table.
If these are rows
Select rows you don't want to print
Go to properties tab
Find Visibility property and click on it
Check Hide Element option
I am trying to put together a Subtable on my report in Visual Studio 2008 with SSRS. The problem I am running into is using a function correctly and referencing a report item via my main report. On my report I have an expression that color codes, when a specific value is returned from the main query. In my Subtable, I want to count each instance of a specific value so for example:
Main Report
Supervisor Employee Ranking
Supervisor 1 Employee 1 Meets (Labeled Orange)
Supervisor 1 Employee 2 Outstanding (Labeled Yellow)
Supervisor 2 Employee 3 Meets
Supervisor 2 Employee 4 Meets
Subtable Outstanding Meets
Supervisor 1 1 1
Supervisor 2 0 2
I have tried using the following formulas
=count(Reportitems!Ranking.Value, "Meets", 0)
=count(Reportitems!Ranking.Value, "Orange", 0)
=count(Reportitems!Ranking.Value = "Meets")
=count(Reportitems!Ranking.Value = "Orange")
I have also changed =count to =countrows and =countdistinct
Can someone help? I am open to anything, I just want the report and Subtable to work correctly.
Once you've got a table grouped by Supervisor (and it looks like you do), you'll need to add a couple of columns with two conditional expressions:
Outstanding column:
=Sum(IIf(Fields!Ranking.Value = "Outstanding", 1, 0))
Meets column:
=Sum(IIf(Fields!Ranking.Value = "Meets", 1, 0))
These will count the occurrences of Outstanding and Meets for each Supervisor that is returned.
This assumes that Ranking is just column in your Dataset - you mention colour coding based on this, but we are only interested in the base value, not the colour.
Edit after comment
If Ranking is based off an expression, you can simply add this into the original expressions above, i.e. something like:
=Sum(IIf(<MyExpression> = "Outstanding", 1, 0))
It's a bit of a generic answer since I don't know what your specific example is, but you can certainly nest expressions in other expressions without issue.
For a more elegant solution, you should consider adding a Calculated Field to your dataset - this defines the expression once in the dataset, then you can use it like a normal field within the report itself. This way you would create a Calculated Field called Ranking in your dataset, then you can use expressions like the ones in the original answer referencing this new calculated Ranking field.