Create default sql query in DashBoard Prompt
Hi,
I want to set the default value in a DashBoard Prompt to current year with a sql query?
thnx, Robbert
You need to create a dashboard prompt and in Default To -> select SQL Results
Click on the ... (three dots ) underneath it and put in your sql
For Example , I have a Table called "Sales Date" in my "ABC" presentation folder. This has a column called "Year" and "Date". If I want to have a Year prompt with the default value set to current year, here is what the syntax of my sql result will be :-
SELECT "ABC"."Sales Date".YEAR
FROM "ABC"
WHERE "Date" = current_date
In SQL, we cannot put SQL as we know of in terms of Oracle, Sql Server etc. The SQL here refers to sql as OBIEE understands it and should be in the form of Select "Presentation foler"."Table Name".ColumnName from "Presentation Folder"
Hope this helps
Similar Messages
-
Presentation Variable in the SQL default section in the dashboard prompt
Hi Gurus,
I have two prompts and two go buttons. First Go button is used to populate pv_category1 presentation variable.
category_column --> pv_category1--> 1st Prompt
Product_Column --> pv_product2 --> 2nd Prompt
I want to set the default for the 2nd Prompt depending on the 1st Prompt ( Category) chosen by the user.
In the SQL default --> i have typed in the below Query.
*Select TableName.Product_Column from Subject_Area where category_column = '@{pv_category1}'*
The Problem is that i dont get any default value for 2nd Prompt after choosing the First prompt and hitting the GO Button.
If i hardcode the value in @{pv_category1} ...
for eg
Select TableName.Product_Column from Subject_Area where category_column = 'Incidents' i get the corresponding value as default.
But i want this 2nd prompt (product) to dyamically default depending on the 1st prompt (category) chosen by the user.
I am using OBIEE 10.1.3.4 and i have googled a lot on this topic...
can we not use Presentation variable in the SQL default section of the Dashboard Prompt?
Any help in this regard would be highly appreciated.
Thanks
AshishThanks for the Quick Reply.
But the functionality that i want to achieve is the default value in the 2nd column (out of many values for 2nd column) based on the 1st column chosen by the USER. for eg we have two columns in our database ie category and Product.. Data goes like this
category ProductName
Incidents --- A
Incidents --- B
Incidents --- C
Changes --- D
Changes --- E
Projects --- M
Projects --- N
Projects --- O
Projects --- P
If the User chooses Incidents in the first prompt then the default in the 2nd prompt should be B ( out of A,B,C Values available in the 2nd prompt)....
Checking the constraint checkbox doesnt solve the default problem...
Thanks
Ashish -
Possible to have dynamic default selections for a dashboard prompt?
I'm running OBIEE 11.1.1.6.5, and I have customer who would like to know if it is possible to dynamically select default values on a dashboard prompt based upon other user prompted columns on the same prompt. For example, I built a dashboard prompt with three fields: Month, Customer, and Product; and I want to add a default selection to my Products prompt to pick the "top 4 products" based on the selected Month and Customer.. assuming every Customer+Month has a different "top 4 products".
Does anyone please have a suggestion on how I could approach this solution?Thank you for your response. I've tested this approach and it seems promising. My concern I have there is how to treat "(All Choices)" values. Say the user selects All Choices on customer or period, and the presentation value in my SQL Results query reverts to whatever default value specified, which is not the intended behavior. My question then becomes how do I treat the null or All Choices and somehow omit the filter criteria or specify fy All Choices as a default to the presentation variable? Your advice is much appreciated.
-
How to get cm:search to use the max attribute when creating the SQL query?
When we use the max attribute in the cm:search tag, it does not seem to honor the max attribute when creating the SQL query. However, the result returned from the tag is limited to the number specified by the max attribute. Then the tag seems to work as intended, but the performance will be sub optimal when the SQL query returns unnecessary rows to the application.
We use the cm:search tag to list the latest news (ordered by date), and with the current implementation we have to expect a decrease in performance over time as more news is published. But we can’t live with that. We need to do the constraint in the SQL query, not in the application.
The sortBy attribute of cm:search is translated to “order by” in the SQL query, as expected.
Is it possible to get cm:search to generate the SQL query with an addition of “where rownum <= maxRows”?Hi Erik,
The behavior of a repository in regards to the search tag's max results parameter is dependent on the underlying repository's implementation. That said, the OOTB repository in WLP does augment the generated SQL to limit the number of rows returned from the database. This is done in the parsing logic. This behavior may differ with other repository implementations.
-Ryan -
Creating an SQL Query for Project Custom Fields Values
Hello:
I'm currently trying to create an SQL Query to show all of the server's Project Custom Fields Values, along with the modification date.
So far, I've managed to display correctly all of the data for all of the Projects' text value Custom Fields (those not based on a LookUp Table) with this query:
SELECT
MSP_PROJECTS.PROJ_NAME,
MSP_CUSTOM_FIELDS.MD_PROP_NAME,
MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE,
MSP_PROJ_CUSTOM_FIELD_VALUES.TEXT_VALUE,
MSP_PROJ_CUSTOM_FIELD_VALUES.MOD_DATE
FROM
MSP_PROJ_CUSTOM_FIELD_VALUES
INNER JOIN
MSP_CUSTOM_FIELDS
ON MSP_CUSTOM_FIELDS.MD_PROP_UID = MSP_PROJ_CUSTOM_FIELD_VALUES.MD_PROP_UID
INNER JOIN
MSP_PROJECTS
ON MSP_PROJECTS.PROJ_UID = MSP_PROJ_CUSTOM_FIELD_VALUES.PROJ_UID
WHERE
MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE IS NULL
ORDER BY
MSP_PROJ_CUSTOM_FIELD_VALUES.PROJ_UID,
MSP_PROJ_CUSTOM_FIELD_VALUES.MD_PROP_UID
However, when I try a new Query to obtain the actual values for the Projects Custom Fields that do use a LookUp Table, I can't seem to find what table in the model I'm supposed to link to the MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE field (the TEXT_VALUE
field has NULL value when CODE_VALUE field isn't NULL)
Any suggestions on how to obtain the actual Projects' custom fields values instead of the Code Value, for Metadata that do use a LookUp Table?
Also, I'm able to run this query only in the Published Database, since the MSP_CUSTOM_FIELDS table is empy in the Draft Database. Why is that?
Awaiting your kind reply,
Sebastián Armas PMO Project ManagerHi Sebastián, rather than directly accessing the database it would be better to use the PSI to get this data. Take a look at the ProjTool sample in the SDK whcih gets this data.
Best regards,
Brian.
Blog |
Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
Project Server TechCenter |
Project Developer Center |
Project Server Help | Project Product Page -
Can we have a Default Value for the dashboard prompt ?
Hi
I have a requirement as when we run the dashboard, dashboard prompt should be defaulted with a value for the first time.
Defaulting the values is done by SQL Results,but when i try to change the values for that prompt it is not showing any other values other than the defaulted prompt.
Ex: I have a dashboard prompt as Employee Name and i have defaulted the value for that with 'Scott' and ran the dashboard.
When i try to run it for different employee i am not able to get other values to be selected.
Do we have any mechanism as such we can have default value when we run the dashboard for the first time and then all the values when we run it for the second time?
Thanksuser12846884 wrote:
Defaulting the values is done by SQL Results,but when i try to change the values for that prompt it is not showing any other values other than the defaulted prompt.
ThanksYou do something wrong. What is the version of OBIEE? How do you create prompt? -
Using variables in the SQL Results in Dashboard Prompt
I use the ff query to limit my results on my dashboard prompt. The variable value is given by a dashboard prompt within the same page.
SELECT Owner.Name saw_0 FROM "iSupport Service Request" WHERE "- Service Request Attributes".Platform =
'@{promptedPlatform}' ORDER BY saw_0
It works fine with this query, only when selecting a particular selection in the prompt that feeds the variable data. Is there anyway to have this particular prompt by default(when the page first loads, load all the values possible prior to filtering by the variable?Hi Harley ,
The frame labels are 1,2,3 etc
sym.setVariable("subselect" , 0); // in the stage composition ready
Then in the menu you can set the "subselect" variable to 1,2,3 and then call sym.play(sym.getVariable("subselect"));
Thanks and Regards,
Sudeshna Sarkar -
Default Selection Issue in Dashboard Prompt
Hi All,
I am using the below logical SQL in SQL Results for Default Selection of a column in a dashboard prompt,
SELECT "Facts"."Service Provider", "Config"."Integration Id" FROM "IMONIT - Transaction Log" WHERE "Config"."Integration Id"='@{inttype}'
Here, I have used a presentation variable, which is set by another prompt. Also the Facts and Config table are joined in RPD. The issue is it does not selects the values returned by the logical SQL by default. But if i use the same logical SQL in SQL Results of Choice List Values for the same column in the prompt, the logical SQL does work and populates the prompt only with the values returned by the logical SQL.
Any help is much appreciated.
Regards,
MariaDeepak, actually the scenario is that I am navigating to the page with the dashboard prompt from another answers report located on another dashboard page. This SQL works perfectly when I press the GO button of prompt on the same page. But its not working when I am navigating to the same page with the prompt from any other report. Any ideas ?
-
Can we change filter column values in a union query using Dashboard prompt
Hi,
I have a requirement in which have to draw a chart report for last six months?.
When i query against database, my query got different where clause for open month and close month.
Say for july month bar, it got close month as july and open month as july, june, may. Like this, for june month bar, it has to have close month as june and open month as june, may, april. like this, i created six union queries using repository variable.
Want to give control using dashboard prompt for close month and open month?
my query look like this.
select close month1, fact1 from table1
where close month = july and open month in (july, june, may)
UNION
select close month2, fact2 from table1
where close month = june and open month in (june, may, april)
UNION
select close month3, fact3 from table1
where close month = may and open month in (may, april, march)
UNION
select close month4, fact4 from table1
where close month = april and open month in (april, march, february)
UNION
select close month5, fact5 from table1
where close month = march and open month in (march, february, january)
UNION
select close month6, fact6 from table1
where close month = february and open month in (february, january, december)
Welcome your suggestions on this?.
ThanksHi Karol,
Yes the prompt is working fine when i put this following method under the "Button" Component.
APPLICATION.openPromptDialog(800, 600);
Somehow the when i use the "Input Field" and use the "Button" Component and write this following logic inside it i don't see the prompt is not taking the values what i am entering in input field i assume that its issue with data-source not getting refreshed.
Variable=INPUTFIELD_1.getValue();
APPLICATION.setVariableValue("PercentageIncrease",Variable);
Thanks,
Kumar -
I cant able to create a new Analysis and Dashboard prompt in OBIEE 11g
Hi Gurus,
i try to create a new Analysis in OBIEE 11g in (brower: ie,Google chrome, Mozila), i got the error "*unterminated string literal*" and "*Exception at function updateSelectionsPanel: unterminated string literal*".
and i try to create a new Dashboard Prompt using column prompt when i select the column i don't get the filter form and not to be add the column prompt in the Dashboard Prompt.
Thanks,Moving this discussion to the Adobe Creative Cloud forum.
Kriskristferson if you are facing difficulties with your order then please contact our support team directly at Contact Customer Care. -
Problem creating an sql query with a parameter which is a list
Hi,
Im having a problem creating a certain SQL query.
The query looks like this:
SELECT gstock_id FROM germplasm_stock gps, germplasm gp WHERE gps.germplasm_id = gp.germplasm_id AND organism_id IN ($childList:VARCHAR).
the organism_id field is of DECIMAL type.
the parameter childList is actually a list of Id's, something like: 123,124,789
and it is created dynamically by an other function, so I cant just put it there staticlly.
I tried using the ARRAY type instead of VARCHAR, but that didn't work,
anyone knows how can I give this query a parameter which is a list of numbers ?
ThanksI have tried all the following options and the same issue occurs:
EXEC dbo.uspGetSiteChanges @ChangeVersion = ?
With Parameter: 0, @ChangeVersion, ChangeVersion
EXEC dbo.uspGetSiteChanges ?
With Parameter: 0, @ChangeVersion, ChangeVersion
In my first data flow I use the following and it works on two OLE DB Sources:
EXEC dbo.uspGetSiteChanges @ChangeVersion = ?
With:
In my second data flow task, I use the same command and parameter mappings and it fails, very strange. -
Need Help with Creating the SQl query
Hi,
SQL query gurus...
INFORMATION:
I have two table, CURRENT and PREVIOUS.(Table Defs below).
CURRENT:
Column1 - CURR_PARENT
Column2 - CURR_CHILD
Column3 - CURR_CHILD_ATTRIBUTE 1
Column4 - CURR_CHILD_ATTRIBUTE 2
Column5 - CURR_CHILD_ATTRIBUTE 3
PREVIOUS:
Column1 - PREV_PARENT
Column2 - PREV_CHILD
Column3 - PREV_CHILD_ATTRIBUTE 1
Column4 - PREV_CHILD_ATTRIBUTE 2
Column5 - PREV_CHILD_ATTRIBUTE 3
PROBLEM STATEMENT
Here the columns 3 to 5 are the attributes of the Child. Lets assume that I have two loads, One Today which goes to the CURRENT table and one yesterday which goes to the PREVIOUS table. Between these two loads there is a CHANGE in the value for Columns either 3/4/5 or all of them(doesnt matter if one or all).
I want to determine what properties for the child have changed with the help of a MOST efficient SQL query.(PARENT+CHILD is unique key). The Database is ofcourse ORACLE.
Please help.
Regards,
ParagHi,
The last message was not posted by the same user_name that started the thread.
Please don't do that: it's confusing.
Earlier replies give you the information you want, with one row of output (maximum) per row in current_tbl. There may be 1, 2 or 3 changes on a row.
You just have to unpivot that data to get one row for every change, like this:
WITH single_row AS
SELECT c.curr_parent
, c.curr_child
, c.curr_child_attribute1
, c.curr_child_attribute2
, c.curr_child_attribute3
, DECODE (c.curr_child_attribute1, p.prev_child_attribute1, 0, 1) AS diff1
, DECODE (c.curr_child_attribute2, p.prev_child_attribute2, 0, 2) AS diff2
, DECODE (c.curr_child_attribute3, p.prev_child_attribute3, 0, 3) AS diff3
FROM current_tbl c
JOIN previous_tbl p ON c.curr_parent = p.prev_parent
AND c.curr_child = p.prev_child
WHERE c.curr_child_attribute1 != p.prev_child_attribute1
OR c.curr_child_attribute2 != p.prev_child_attribute2
OR c.curr_child_attribute3 != p.prev_child_attribute3
, cntr AS
SELECT LEVEL AS n
FROM dual
CONNECT BY LEVEL <= 3
SELECT s.curr_parent AS parent
, s.curr_child AS child
, CASE c.n
WHEN 1 THEN s.curr_child_attribute1
WHEN 2 THEN s.curr_child_attribute2
WHEN 3 THEN s.curr_child_attribute3
END AS attribute
, c.n AS attribute_value
FROM single_row s
JOIN cntr c ON c.n IN ( s.diff1
, s.diff2
, s.diff3
ORDER BY attribute_value
, parent
, child
; -
Using a Variable to create the SQL Query
I need to create a "dynamic" Update query. I want to store
the meet of the command in a variable and then reference the
variable in in query.
Example:
<cfquery name="fred" datasource="mydb">
update db_table_name set
pbname = 'Fred Flintstone',
pbnumber = '555-555-1234'
pbage = 25
where recnum = 24
</cfquery>
I would like use code this:
<cfset upst = "pbname = 'Fred Flintstone', pbnumber =
'555-555-1234', pbage = 25">
<cfquery name="fred" datasource="mydb">
update db_table_name set
#upst#
where recnum = 24
</cfquery>
When I run this, I get the following error message:
Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error
(missing operator) in query expression ''Fred Flintstone''.
The SQL line is:
update db_table_name set pbname = ''Fred Flintstone'',
pbnumber = ''555-555-1234'', pbage = 25 where recnum = 24
I know its hard to see, but the '' are 2 ' not 1 " . I have
no idea why Coldfusion (or maybe the ODBC driver??) is placing the
2nd ' in the command which causes the errors.
Can anyone shed some light on this topic?
While this is a simple example, my application is far more
complex. I have over 50 fields in the udpate and depending on
changes to the form values, I may need to update all the fields,
some of the fields or NONE of the fields.
I can use <cfif> to test if any fields have changed and
if so, include them in the update command, but if NONE of the
fields have changed, I would have an empty update command and
therefore get an error. I want to avoid having to test for changes
twice (once to determine if I am doing the update and twice to
perform the update).
Thanks,
Mike.cf automatically escapes the single quotes, so you need to
preserve them
<cfquery name="fred" datasource="mydb">
update db_table_name set
#PreserveSingleQuotes(upst)#
where recnum = 24
</cfquery>
Ken -
How can I create an sql query updateable report
Seems as though after upgrading our APEX version I no longer have the option to create an updateable report. Some of my old updateable reports seem to be working fine but some will not update after I click my submit button. AT first they just refreshed the page and ignored my changes to the data in the text field. After tinkering with the non working region, now I get a ORA-20001 current version of data in database has changed etc.
HELP!Hi,
OK - first, you can still create an Updatable Report. When you create a new report, select the Wizard Report option and follow the prompts. When the report has been created you can then switch it to be updatable. I don't know why it has been done this way, but that works.
Second, on the reports that return that error, do you have any columns set a Standard Report Column? I have found that you need to include ALL columns in the data being submitted, even if that means you have to create a second instance of a column in your SQL statement and then make one of the columns Hidden. For example, if you created a Tabular Form using the wizard on the EMP table, you get EMPNO and EMPNO_DISPLAY, with EMPNO hidden. You would need to do the same for any column not being edited by the user. Something similar may also happen if you have made any of the INPUT items readonly or disabled as these are not submitted by the browser.
Andy -
I have one query which is giving me employee details like job, name organizaiton.
Also there is one custom table in which I am updating one flag like attribute20 to 'Y' depending upon some condition.
Now I want to make a query like it show only record on those employee whose flag is null.
Now the issue is this that it may be possible that my custom table could not have the record of some employee but i want to show the details of that employee.
Please revert in case you are not getting ....
Regards
RGBhere is the query and I think it work but i am not sure.... Can somebody double check it.
SELECT rownum, a.full_name, a.employee_number, a.doj, a.client, a.org, a.job,
(SUBSTR (POSITION, INSTR (POSITION, '|', 1, 4) + 1)) process,
a.supervisor
FROM xx_xx_v a, xx_supervisor b where a.EMPLOYEE_NUMBER=b.EMPLOYEE_NUMBER(+) and nvl(b.attribute20,0) != 'Y'
Regards
RGB
Maybe you are looking for
-
Copy favorites from Windows 8.1 folder to Bookmarks
I just restored my backups from Carbonite to a new computer with Windows 8.1 (old computer was Windows 7) using Firefox. I kept a folder of my bookmarks in my documents. How can I get them into the new bookmarks? I found a folder called "bookmarkback
-
i have two computers. my laptop has os 10.6.8. my mac mini has 10.5.8, hence no app store. can i buy lion on my laptop and then burn a dvd of it and install it on my mac mini or does it have to be installed on the same computer it is bought with?
-
Continuation of line item data to next page in SmartForm
Hi, Currently i had a requirement in SmartForm. Iam displaying the line items from bseg table in main window and totals of credit and debit in the total window which comes under the main window. If the line items are more and it continues to next pag
-
Why do we have to type everything?
1119: Access of possibly undefined property ***** through a reference with static type *****. This is a very annoying error. What I want to know is why do we have to re-type pretty much all our variables? I add an object with a variable towers (array
-
Facing Problem in XD01 Function Exit
Hi, I am facing the problem in XD01 Function Exit EXIT_SAPMF02D_001. whenenver i am going active the include ZXF04U01, it is always creating the Local change request. But It is should be Transportable change request. That is why, the Basic people is