SAP BO - Avoiding PROMPT in case of presence of a context - business-objects

I am new to BO and want to understand the below scenario.
I have three columns.1) Year 2) Region 3) Amount
Region has three values--> A,B and C. Here C is total of A and B.
In the universe , I have 3 contexts defined: 1) Year and Region-A , 2) Year and Region-B, 3) Year and Region-C
Case1:
Now in Webi, when I drag Year and respective regions along with the amount metric, the report will show the amount of the respective regions based on the context defined in the universe.
Ex 1: Year-2019 , Region- A , Amount-50
Ex 2: Year-2019 , Region- B , Amount-100
Ex 3: Year-2019 , Region- C , Amount-150(Sum of Region A and Region B)
Case2
Now when I drag the YEAR and AMOUNT , the amount gets doubled because it groups by all the regions leading to duplication.
Ex : Year- 2019 , Amount-300
So, in order to avoid the duplication I am including a PROMPT in the AMOUNT measure which will ask to enter the REGION value
So,in Case1 ,because of the PROMPT, the context will come into play and also the PROMPT will appear in Webi.
I wanted to understand, is there a way to avoid the PROMPT when the attributes are pulled as per Case1 because the context is also already working out there.
Thanks in advance.

Your question is a bit weird formulated, but if I understand it correctly you have 1 webi report in which you have 2 tables one with region,year and value and 1 with only year and value. And you want to add a prompt only on the second table so it doesn't group it?
If this is the case you don't need a prompt, because you can't use a prompt on one table, what you need is an input control on your second table because input controls can be set specific for separate elements of a report. You can set the input control on region for your second table.

Related

Trouble creating nested SUM IIF expression in SSRS

I am new to SSRS and have a SUM(IIF question.
My data set contains four columns: Date, GroupID, PlanPaid, and NetworkIndicator.
Here is an example of the data set:
I am trying to SUM the [PlanPaid] amount when [NetworkIndicator] = "In Network".
However, I need this amount broken up by the [Date]. I tried accomplishing this by creating the expression:
=Sum(IIf(Fields!NetworkIndicator.Value = "In Network"
, Fields!PlanPaid.Value
, Nothing)
, "Claims_Rolling12")
But this expression returns the same amount (total) across all [Dates]. How do I break it up so that it is grouped by the correct [Date]?
Here is a photo of my Tablix and my current Groups: [Tablix and Groups]
And here is a photo of the output: [Output]
You haven't said where you want this sum to appear, so the answer here might not work. If it doesn't then edit your question to show what you expect the output to look like based on your sample data.
I'm assuming here that you want to add a new column to the report that shows "In Network total" by date.
The easiest way to do this is to add a row group that groups by date, then within this group you can use a simple expression, like the one you tried, but without specifying the scope.
=SUM(IIF(Fields!NetworkIndicator.Value = "In Network", Fields!PaidPlan.Value, Nothing))
This expression will only sum rows that are within the current scope, in this case the scope will be the row group you created to group by dates.
As IO said, if this is not helpful, edit your question and show what you expect your end result to look like, based on the sample data you supplied and then I can look at it again.

SSRS Total by Type

I am new to SSRS. I have a report that goes like this
Type Amount
A 500
B 200
A 100
C 400
C 200
I want to convert this to a report like this
Type Total Amount
A 600
B 200
C 600
Basically get distinct Types on the left column and th totals for those types in the right column. Is there a way i can do that easily?
Thanks
Starting with you simple report which just lists the records in your DataSet:
Design:
Results:
Right click on (Details)in the Row Groups section and choose Add Group -> Parent Group:
Choose the field you want to group by (Type in our example) from the Group by: dropdown, choose to add either a group header or footer and click OK:
Your table will now look something like this:
You can delete the second column and the third row - or second row if you chose to add a group footer earlier - entirely (clicking OK when deleting the row and being prompted to delete the associated group), leaving a layout like this:
Now just click the field selector for the empty cell in the table and choose your Amount field:
or right click on the empty cell, choose Expression from the context menu and enter the following expression:
=Sum(Fields!Amount.Value)
either of which should result in the formula being placed into the cell:
Now run your report and you should get the expected result:
There's loads of places online with similar guides and resources which you can also consult:
MSDN Reporting Services Tutorial (Adding Grouping and Totals)
MS TechNet (Calculating Totals and Other Aggregates)
MSDN (Add a Total to a Group or Tablix Data Region)
There are also several other similar questions here on SO which you'll find if you just search for them.

Stata related -selecting specific rows

I am currently working with a dataset that has information on individuals i = 1,...,N by time t = 1,...,T. I basically have a panel structure in my dataset. However, I want to select only one row of data from each individual. Specifically, I want to select only the last time period t=T for each individual i=1,...,N. How can I 'extract' this specific information from the bigger dataset?
In Stata [not STATA] rows are more properly called observations. You can "select" the last observation in each panel with the generic
bysort id (time) : ... if _n == _N
as under the aegis of by:
the built-in variable _n identifies observations in each panel
its sibling _N is the number of observations in each panel and therefore identifies the last observation in each panel.
This is well documented: e.g. see the help and manual entries explaining the by: prefix.

Sum Values from Dataset based on condition: Report Builder

I have a report where users can select items from various location. And I have 3 datasets performing calculations where the third dataset takes the sum where item number is 4942200 and then calculates the values (as shown below):
=SUM(IIf(Fields!masterno.Value= "4942200",Fields!Owned.Value,0))+SUM(IIf(Fields!masterno.Value= "4942200",Fields!Subbed.Value,0))
This is returning error for some reason. The subbed column is toggled based on parameter (visibility). But before I add the toggle functionality, I want to make sure this is working. Can anyone help. I have also tried:
=SUM(IIf(Fields!masterno.Value= "4942200",Fields!Owned.Value+Fields!Subbed.Value,0))
This seems to fail as well. Help would be greatly appreciated.
I would wrap a CDec around Owned, 0 and Subbed, e.g.
=SUM(IIf(Fields!masterno.Value= "4942200",CDec ( Fields!Owned.Value) ,CDec (0 ) ))+SUM(IIf(Fields!masterno.Value= "4942200",CDec (Fields!Subbed.Value ) ,CDec ( 0 )))
If Owned and Subbed are already Decimals, those CDec's may be redundant. On the other hand SSRS doesnt expose this info and they can change at the whim of the data source.

In SSRS is there a way to make a Row Group expand based on parameter value?

I've got a table with 5 columns, the first 3 of which allow the user to drill down through the levels of detail. Each of these columns (Region, Country & Office) has an associated Parameter so the user can select the geographic region for their report. Each parameter allows the selection of multiple values.
If the user selects 1 Region, 1 Country and 1 Office it's not exactly ideal for them to then have to expand each selection. Is there an expression I can enter somewhere to state that if only 1 value is entered in a parameter then that data set will automatically show as expanded?
This is in SSRS 2008 R2 if that makes any difference.
In the Group Properties for the detail group you can enter an expression for the initial visibility. Right now you probably have that set to "Hide." The expression needs to return a Boolean and could be something like:
=Parameters!Country.Count <> 1
This will have SSRS hide those rows if more (or less) than one value are selected in the parameter Country
But I have seen some unexpected results with this: test thoroughly. In my experience, BIDS handles these better than SSRS itself, so just when you think you've got it all working, it fails miserably once deployed. (Reason number 14 to have a test folder on production SSRS.)