How to load parameter data based on the selection of another parameter? - sql

I´m using BIRT Report Designer to create a report to obtain data of different tables.
Table 1:
ExhibitorStore:
IDExhibitor
IDStore
NameExhibitor
ExhibitionProduct:
IDExhibitor
IDStore
IDProduct
Each store have different exhibitors, and each exhibitor have different products.
So, I'm creating a BIRT that has a select list, that show a list of stores, and another select list that show the list of the exhibitors that belong to store.
I couldn't find a way to make that dynamic, when I change the store in the select list, change the list of exhibitors that belongs to the store.
This is image when I run the BIRT with default select option of stores, the exhibitor shows is right.
This is image when I run the BIRT with default select option of stores, and change value of select.
The options of exhibitors not change.
But if I change the option of the select show for default and I run the BIRT, show the exhibitors of the store that show for default.
Should I define some property in the parameter "Store" so that when change the option of the select list of store, the select of exhibitor is refreshed?

To achieve this behavior you have to create a cascading parameter group
You can download an example here:
https://download.eclipse.org/birt/downloads/examples/reports/2.1/cascade/cascade.rptdesign
A cascaded parameter group allows a group of parameters to be interlinked, where selecting a value for the first parameter affects the choices available in the subsequent parameters. Cascaded parameters can be tied to one or more Data Sets. The Data Sets populate each level of the cascade. Combined with Data Set parameters this offers very good flexibility for culling of returned data for a report.

Related

How to condition an APEX LOV when using APEX_ITEM to create a dropdown list within an interactive report?

Hi everyone I am having a bit of a difficult time even trying to find articles on apex collections and the apex_item functionality but was wondering if anyone has any experience on how to condition a LOV when the the select list has been generated using APEX_ITEM.SELECT_LIST_FROM_LOV.Im still pretty new to using this functionality so I hope this does come across well and makes some sense!
I am currently using Apex 19.1 with oracle database 12c!
We have an apex app we are building and our users want the app to allow the user to pick the number of rows as the number of rows needed can vary for each user, so we achieved this by creating a page item that allows the user to select a number from 1 to 50 - this then generates an interactive report based on this number where the user can then select a further options within 3 select lists as shown below.
We have shown this concept to the business and they really like how this all works. They have identified a requirement where they would like these select lists to then be conditional before the selection is then passed into apex_collections so that when the 'Export From' option is selected it will only allow the user to see the countries that are available within the 'Import To' select list. Furthermore once the country has been selected they want the 'Depot DST' option to only show the available options for the selected country.
I have attempted to look at the select query within the shared component LOV for the application and change this around but I assume because there is no page item associated with the selected values that this wont work as the select list keeps going blank when testing out any changes I make. Any help or advice on how to achieve this would be greatly appreciated.
Regards,
Helen.
have you tried this:
under columns of your report select the column you want to be conditionally filled, when select on the right side of the apex developer look for the List of values submenu and the Cascading LOV Parent Column(s)
there select your parent column and incorporate the column in the where clause of your select for the list of values, pointing at it like this :YOUR_COLUMN NAME

Rendering a report based on variable in COGNOS Report Studio 10.2.2

I am designing a report in IBM Cognos Report Studio 10.2.2 that includes a list of different types of disabilities and the count of employees that have each type of disability. However, this list is only supposed to display if there are at least 10 employees with some kind of disability.
I tried solving this problem by creating a separate query (Disability summary) with a data item (Disabled) where each employee gets a 1 if they have a disability and 0 otherwise. I then added another data item (Number disabled) that I define as:
total([Disabled]) for report
I then create a Boolean variable in the Condition Explorer (Disabilities Reportable) which I define as:
[Disability Summary].[Number disabled] >= 10
Next, for the list that displays the count for each type of disability, I set the Render Variable to Disabilities Reportable. I also place a singleton elsewhere on the report page and set the query to Disability Summary and check Number disabled as a property. I also insert the Number disabled data item in the singleton.
However, when I run the report, I get the following RSV-VAL-0032 error:
The following expression is not valid: [Disability Summary].[Number disabled] > = 10.
If the item exists in a query but is not referenced in the layout, add it to a property
list. CRX-API-0005 An error occurred at or near the position '0'. The variable named
'[Disability Summary].[Number disabled]' is invalid.
Render Variables need to be accessible to the Page where they are used. If it works in a Report Expression, it will work in a Render Variable.
This means you must use prompt variables, built in Report Functions, or the query that is tied directly to the Report Page.
Assign the query that you are pulling your disability count from to the Report Page, then set the disability count field as a 'Property'. This makes the field accessible to the report for formatting and Report Expressions.
Click anywhere in your report, then on the properties panel click the Up Arrow to drill up the the very top, the 'Page' level. (Alternatively, Page Explorer->Report Pages->Double Click the Page you are working on)
Define the 'Query' and 'Properties'.
Creating a separate summary query is perfectly acceptable. If your summary is at a different aggregate level than the details of your list, Cognos is going to create a separate query and make separate database trips anyway. Use whatever method works and makes sense for you.

SSRS Report, shared layout, using different data sets

We need to create several reports but they all have the same exact layout. Rather than creating many reports, is it possible to create a single report that can conditionally be populated by different sets of data?
For example, say the report is a simple list of customer names and addresses. I would like to have a parameter that asks for a customer type. A second drop down parameter list would only show customer subtypes directly related to the parent customer type. Can a parameter drop down be filtered based upon a selection in another parameter drop down?
What other ways can I manage a single report layout but populate with different sets of data based on parameters?
is it possible to create a single report that can conditionally be
populated by different sets of data?
Yes, it is possible as long as the multiple data you use fits the structure of your report. Using parameters you can populate your report with different data.
Can a parameter drop down be filtered based upon a selection in
another parameter drop down?
Yes, A parameter can be populated based on other parameter selection. There are a lot of resources in the web that ilustrate how to achieve that functionality. Give a try and if you get stuck we are here.
What other ways can I manage a single report layout but populate with
different sets of data based on parameters?
You can select the data in your report by using multiple parameters and a single dataset. Then using SQL statements and parameters you can filter from where clause or create a flow in multiple select statements using T-SQL. Something like
IF #my_param = 1
BEGIN
select ...
END
ELSE
BEGIN
select ...
END
Let me know if this helps you.

Qlikview: how to create summary table to filter multiple associated tables

I have 4-5 tables of single and many rows per ID. I want to generate a summary table listing each ID along with various counts and max/mins, but I want to be able to filter on calculations. Example: "ID" is the identifier and there are two tables, TestA and TestB.
One desired selection criteria: Show only those IDs where at least one TestA score >5 and there is at least one TestB score.
In a straight table, this is simple to do with expressions, but the resulting table cannot be selected on the calculated true/false value.
I think I need to create a new table in the load script containing the ID, and then various conditions labeled as I wish. Then, these fields could be dimensions. This seems similar in concept to a master calendar. Am I on the right track?
If it helps to understand my example, this a medical application; the tables are lab results and other interventions that each require complex queries pulling data from various sources that are very "hard-coded" to produce a small data set from millions of rows of highly normalized source data. The desired dimensions would be combinations of the labs so as to allow identification of patients who meet certain criteria--then, once filtered, there would be many more graphs and charts to identify what tests and procedures were followed for that group of patients.
My current data model just loads many tables which then associate on ID. I had attempted to load all data into one big table using concatenates and calculations, but this did not seem to accomplish what I needed and was difficult to manage.
IIUC, I think what you want to do can be accomplished with a combination of sliders/input boxes, variables and calculated dimensions in your table. The process is definitely burdensome, but it should allow you filter the way you want.
Add a field to your table load statement in your script like rnum as RowNo().
Create a variable for your filter(s). Ex. vFilterTestAScore.
Add a slider or input box to your dashboard and point it to that variable.
a. For slider, the option is in the General tab -> Data header -> select the Variable radio button.
b. For input box, add the correct var from the list to the list of Displayed Variables.
Set sliders/input boxes to the criteria you want: vFilterTestAScore = 5 and vFilterTestBScore = 1
Create a straight table with ID as the dimension and expressions for TestAScore and TestBScore. The expression formulas would be sum(TestAScore) and sum(TestBScore) respectively (this won't make sense until the next step).
Now add a calculated dimension to you table. The idea here is that rather than just having the ID dimension, you will create a calculated dimension that only displays the ID of the records that meet the criteria you select in the slider or enter in the input box. The formula should be something like:
if(aggr(sum(TestA), rnum) >= vFilterTestAScore, ID, null()) or for multiple filters: if((aggr(sum(TestA), rnum) >= vFilterTestAScore) and (aggr(sum(TestB), rnum) >= vFilterTestBScore), ID, null()).
On your new calculated dimension, check the 'Suppress When Value is Null' box so only results that meet your criteria are displayed in your table.
To summarize, you are using the variables to store your selection criteria which you are entering via input box or slider. Then you are conditionally displaying only the ID's in your table that match those criteria via a calculated dimension and 'Suppress When Null' option.
I can send you a .qvw if you aren't using the free personal edition and are able to open other qvw's.

SQL Server Report Builder Information in Parameter Pane

Is it possible to show additional information in the parameter pane based on the parameter the user selects? What I would like to do is allow the user to select a store from the parameter dropdown list and after the user selects the store they would be able to see the Store name, street address, city, state and zip to ensure they selected the correct store before they 'View Report'.
Generally, this is not possible, but I can propose a workaround, which is a bit silly, though.
Create a dataset which takes a Store ID as a parameter and returns the store name, address etc.
Add another several report parameters of type text that will represent the name, address etc correspondingly, and set their default values to the required fields in the dataset created in step 1.
Link the dataset's parameter to the report Parameter Store.
Once a user selects a store from the parameter dropdown, the rest parameters will be populated with the data.
Hope it hepls.