I have created a parameter Division in OBIEE which is a string and has menu type. When I give the option to select all, by default, null values are passed and hence, the report returns no rows.
I tried using nvl command, "Division" IN (nvl(:division_param, "Division")) which did not work.
Also, I tried to use division<> null in the SQL LOV which did not work. Another option is to use multiple selection and disable select all. But select all option is very important for this report. Please let me know hoe to fix this issue or any work around is appreciated.
Pic
You can change the radio button to pass all values instead of null
Related
I have a business requirement that requires a user to be able to search for many different order numbers and be presented with additional information through my report. Since we have a very large amount of orders on any given day, I want them to be able to copy and paste the list into the SSRS Parameter (which I have setup fine now). I also want them to be able to run the report 'wide open' and have them be able to leave the parameter blank and return all orders.
I have achieved this in the past while using 'Available Values' for the parameter. But, now that I am doing it manually, I am coming across a lot of pesky errors.
I believe I am close.. I have the following simplified query:
SELECT
AssignmentNumber,
OrderNumber
FROM
tables.Activity
WHERE
((OrderNumber in (#P_ORDER_NUMBER)) or (#P_ORDER_NUMBER = ''))
When I run this, I have success in 2 of 3 scenerios
When #P_ORDER_NUMBER is left empty, it returns all orders
When a SINGLE order is provided, it returns assignments on that order
The final issue is getting it to work with multiple Orders. I am getting an Error in SSRS reading 'An Expression of Non-Boolean type specified in a context where a condition is expected, near ','.
I assume there's in issue in the OR clause that I have.. but I haven't been able to find a workaround that meets the business need. Any ideas? Thank you!!
The following is not perfect, as it won't work if some orders are selected and then the report is re-run with no orders selected but is might be OK for your needs...
Add a new parameter to the report, I called it pBlank in my tests. You can set this to hidden once the report is complete. In the default value I used the following expression.
=IIF(LEN(Parameters!P_ORDER_NUMBER.Value(0)) = 0, 1, 0)
So it will be 1 if the order parameter is empty or 0 of it is not empty. It does this by checking the length of the first value. This is assuming the user does not have add a blank value as the first value, if they do then you could do something similar by checking the .Count property too.
Then just change the dataset query to something like
SELECT
AssignmentNumber,
OrderNumber
FROM tables.Activity
WHERE (
OrderNumber in (#P_ORDER_NUMBER)
OR #pBlank = 1
)
It may just be hung up on the empty string concept. Try allowing the parameter to be NULL - the user will get a little checkbox that says "null" - and for the parameter prompt say
Enter order number(s) or check "null" for all:
Change your query to ...or (#P_ORDER_NUMBER IS NULL)
This has always worked for me. HTH
I am currently working on a project on MS-Access 2010 and I am struggling with a issue for hours. I would like to apply a filter on a SELECT/PIVOT statement. The result of that query is displayed in a ListBox.
The issue is that no results are displayed when the Combobox is set to Null. But when I select specific values in that Combobox it works perfectly.
The Cbbox filter is declared as a Parameter
My query WHERE clause looks like this :
WHERE (Jobs.fk_group=[Formulaires]![frm_MAIN]![lst_filterGroup] AND (fk_otherCritera='XXX'))
OR ((([Formulaires]![frm_MAIN]![lst_filterGroup]) Is Null) AND (fk_otherCritera='XXX'))
The query WORKS while I enter manually the value of the parameter (=when I enter an empty string, it displays all the records = what I want)
Idk if it is important, but also the listview that I use swap dynamically its recordsource (=it runs 2 differents queries), depending from another Cbbox
I checked the parameters values into my VBA code just before MyListview.Requery calls and IsNull(myCbboxReference) returns True and my other criteria is also OK.
I have no clue of what I did wrong, I need help :-(
Best regards, LR
I would recommend to use special value in combobox for displaying all records in main table and don't rely on comparing with Null values. Your query, probably, doesn't work because empty combobox returns "" , not Null.
Also be careful with queries based on references to controls/parameters. Access has a bug: if you apply filter on data in the form, based on query with such kind references, it stops read new values from controls/parameter during Requery. It appears at least for subforms in Datasheet mode. Workaround for this bug - using function instead of reference.
So, the problem is that report on SSRS is executing immediately after opening. I use query based default parameters.. And i saw the solution with adding additional parameter without default value. It doesn't work for me because of the textbox which cannot be hidden (i tried to hide it and report stop working).
So is there a way to hide this additional parameter? or maybe another way to solve this issue?
The problem is happening because you are setting a required parameter as nullable or you are giving it a default value that is invalid. To fix the problem, remove the default values. When you go to the report it will not be able to run until you give it the required value(s).
There can be two solutions to it.
Set the default of the parameter in question to such a value that would absolutely have no matches in dataset. Say for example, the parameter is Location. Give the defalut value as "Mars". (Unless of course you build software of extra terrestrial beings). This way the report will execute pretty fast, without any errors.
Set the default value of the parameter to be NULL. Add a dataset filter like below:
=IIF(ISNOTHING(Parameters!Location.Value), TRUE, FALSE)
Using IsNothing function you can ask dataset to return rows only when the parameter has values.
Let me know if either approach works out.
MS Access 2010 brings an error (Enter Parameter value) when I try to perform the following very simple Union query:
SELECT
[1_Toyota_2013_mit_PFC_2].[FC-Teile-Nr]
FROM 1_Toyota_2013_mit_PFC_2
UNION
SELECT
[1_Toyota_2013_ohne_PFC_2].[FC-Teile-Nr]
FROM 1_Toyota_2013_ohne_PFC_2;
Everything is specified... I understand that having "-" in the names forces me to use brackets. I am doing that, but it still causes an error. If I simply press OK, then I do get the correct result. But I'd like to have the error not pop up.
Any idea why this happens?
Thanks!
My query was based on two sub queries. The unspecified parameter was a calculated field in one of the sub queries that I had created. After creating the field, I subsequently changed the name of one of the tables, and while Access updated all the other query fields, it did not ofcourse update my manually created calculation.
Thanks for the probing questions that led me to the answer 4dmonster!
I'm creating a report where I want to send a parameter for the number of records to display (I do not want to select the number of records in SQL)
I have created a parameter field (?topN) and set the group to use this value which in design mode works well however when I try to set this parameter in vb.net code it does not work.
The field which also displays the value shows the parameter correctly though.
Any ideas?
Thanks
Try this in the Section Expert, in the Suppress code option:
Recordnumber > ?#topN
If you are grouping, you could use the TOP-N feature of group sorting.