Using substring function in the dashboard prompt

Hi,
I want to use a function in the dashboard prompt.
Example: Subject Area:Paint --> Products --> Color
I want to take second letter of color, describe a label for it and use this label in prompt. The formula is below;
CASE WHEN (SUBSTRING(Products.Color FROM 2 FOR 1) = 'a') THEN 'AAA' ELSE 'BBB' END
Dashboard prompt should list 3 choices; All choices, AAA, BBB.
When selecting AAA in the prompt, these colors should be listed in the request; Carriage House Red, Dante, Manchester Red.
I created a dashboard prompt (add a function) and a request. When selecting AAA in the prompt, it sends "AAA" as prompt, not sends "a". So I couldn't reach the result.
Is it possible? Could anyone help me ASAP?
Thanks & Best Regards,

Create a column in the logical layer using the same formula that you described. Then use the new column in the prompt. Then add the new column to the report as 'is prompted'.

Similar Messages

  • Using substring function in the Universe

    What is the correct syntax of using the substring function in the Universe?
    I need to extract the numbers and decimal between the #'s, and the character length varies:
    From: DOE, JOHN  Added the following entry to work history:
    A1S#0.25#
    To: 0.25
    Please help!  Thanks!

    There are ticket details in the text - I replaced certain letters with x, o, or a.  I thought you would need the total number of characters in the text.
    0.25#"
    DOE, JOHN A Xddxd xxx xxllxwOIg xIxxI xx wxxk xOXxxxI:
    A1S#0.25#"O xxxxd Oxck xxxm CJ, xx XxOd xxxx wx xxx XuppxXxd xx Ox gxxxOIg xlxxxX xI xxOX.  Xx, xxx quxXxOxI xxmxOIX wxxx xx dx Ixw?  XOxxxx wx mxkx xxx dxcOXOxI xx OgIxxx xxOX cxIdOxOxI xId xxvx Ox xxmxvxd xxxm XmxxxX, xx wx xxI xx xxXxxxcx xxp xxlkxxX xId Xxx Ox wx cxI Xxxp Xxmx xx xxx xxxxxOc, xx wx xxdxx x OOggxx cOxcuOx xx xxIdlx xxx OuxXxX wOxxxux xII dxxpX.  O'll xxI xx xuI xxOX OI mxIxgxmxIx xId xxx xxXx xx xxx xxxm xx Xxx wxOcx wxI wx wxIx xx gx".
    1#"
    DXX, JXXN X XddXd xxX xxllxAxng XnxrN xx Axrk xxAxxrN:
    A1S#1#"X dxn'x AXX xxxA xn AxnAxrd.  X AxA gxxng xx AxXAk xxX xnxXrxxAX xx AXX xx ApxkXA xn xxrxugxpux AXrX xbAXrvXd xA xxA bXXn AuggXAxXd, xxAXvXr, xxA nxx xn AxnAxrd.  X AxXAkXd Dxrx xnd dxn'x AXX xnN xndxAxxxxn xxxx xxxA xA xn xnN xlxrI grxupA xxr xxrXAxxld Ixnxxxrxng, Ax X'I AxndXrxng AxXrX xxX xlxrI xA AxIxng xrxI.  Xx Axuld bX xxxx xxXrX xA nx xnxXnxxxn xx bX xlxrIxng xn xxxA xx xll xnd xxX xlxrIA Axuld bX AxIxng xrxI xn xld Ixnxxxrxng AxurAX xxxx xA nx lxngXr vxlxd (xX, xxxA AlxppXd xxrxugx xxX ArxAkA AxIXxxA).  X AXnx xn XIxxl xx AurxxA JxnXA xx AXX xx xX Axn xXll Axxx xxX AxurAX xx xxX xlxrI xA (xX, Axxx Ixnxxxrxng ANAxXI xAxuxllN gXnXrxxXd xxX xlxrI)."
    0.5#
    DOE, JOHN A Xaaxa xax OolloxixI xxxIx xo xoIk aisxoIx:
    A1S#.05# "XIxxsOxIIixI xo IXS XixI x quxux OoI xaaixioxxl ixOoIoxxiox xxa Ixcoooaxxioxs."

  • How to use Substring function with Case statement.

    Hello Everyone,
    I have one requirement where I have to use substring function on the field for report criteria.
    E.G.
    I have Branch Name Field where I have all branch names information, Now some of the branch names are too big with some extension after the name .
    now i want to substing it but the character length varies for each branch.
    so is there any way where we can use case statement where we can define that if branch name character are exceeding some value then substing it with this length.

    Try something like this:
    CASE WHEN LENGTH(tablename.Branch_Name) > n THEN SUBSTRING(...) ELSE tablename.Branch_Name END
    where n is the number of characters you want to start the break.

  • Using substr function loses index. Query tune help

    Hi
    when i use substr function in the join condition it loses index and the query is slow. How to fix this problem or tune this query. These are the lines in the query.
    and substr(a.invoice_num,1,9) = l.invoice_num
    and substr(c.invoice_num,1,9) = mgr_apprv_lst.user_key
    and substr(c.invoice_num,1,9) = pbl_apprv_lst.user_key
    select
    pap.full_name employe_name,
         k.SEGMENT1 ||'.' ||k.segment2 Cost_Center,
         a.invoice_num Invoice_Number,
         b.item_description Line_Item,
         b.amount Amount,
         cc.trx_id Corporate_Card_Transaction_Id,
         cc.transaction_date Date_Charge_Incurred,
         cc.posted_date Date_Charge_Posted_To_USBank,
         cc.creation_date Date_Posted_To_IExpense,
         a.creation_date Expense_Report_Creation_Date,
         l.report_submitted_date Expense_Report_Submitted_Date,
         mgr_apprv_lst.activity_begin_date Managers_Approval_Begin_Date,
         mgr_apprv_lst.activity_end_date Managers_Approval_End_Date,
         pbl_apprv_lst.activity_begin_date AP_Approval_Begin_Date,
         pbl_apprv_lst.activity_end_date AP_Approval_End_Date,
         e.check_date Payment_Date_To_USBank,
         e.check_number Payment_Number,
         mgr_apprv_lst.activity_result_display_name Managers_Process_Result,
         pbl_apprv_lst.activity_result_display_name AP_Process_Result
    from
         ap_checks_all e,
         ap_invoice_payments_all d,
         ap_invoices_all c,
    ap_expense_report_headers_all a,
         ap_credit_card_trxns_all cc,
         per_all_people_f pap,
         ap_expense_report_headers_all l,
         ap_expense_report_lines_all b,
         gl_code_combinations k,
         (select ias1.user_key,
         ias1.activity_result_display_name,
         ias1.activity_begin_date,
         ias1.activity_end_date
    from wf_item_activity_statuses_v ias1,
    (select c1.invoice_num
         from ap_checks_all e1,
         ap_invoice_payments_all d1,
         ap_invoices_all c1
         where trunc(e1.check_date) between nvl(:From_Date, trunc(e1.check_date))
         and nvl(:To_Date, trunc(e1.check_date))
    and e1.org_id = 141
    and e1.void_date IS null
    and d1.check_id = e1.check_id
         and c1.invoice_id = d1.invoice_id) inv_lst1
    where ias1.item_type = 'APEXP'
    and ias1.user_key = inv_lst1.invoice_num
    and ias1.activity_name = 'AP_MANAGER_APPROVAL_PROCESS') mgr_apprv_lst,
    (select ias2.user_key,
         ias2.activity_result_display_name,
         ias2.activity_begin_date,
         ias2.activity_end_date
    from wf_item_activity_statuses_v ias2,
    (select c2.invoice_num
         from ap_checks_all e2,
         ap_invoice_payments_all d2,
         ap_invoices_all c2
         where trunc(e2.check_date) between nvl(:From_Date, trunc(e2.check_date))
         and nvl(:To_Date, trunc(e2.check_date))
    and e2.org_id = 141
    and e2.void_date IS null
    and d2.check_id = e2.check_id
         and c2.invoice_id = d2.invoice_id) inv_lst2
    where ias2.item_type = 'APEXP'
    and ias2.user_key = inv_lst2.invoice_num
    and ias2.activity_name = 'AP_PAYABLES_APPROVAL_PROCESS') pbl_apprv_lst
    where
    trunc(e.check_date) between nvl(:From_Date, trunc(e.check_date))
    and nvl(:To_Date, trunc(e.check_date))
    and e.org_id = 141
    and e.void_date IS null
    and d.check_id = e.check_id
    and c.invoice_id = d.invoice_id
    and a.invoice_num = c.invoice_num
    and a.source = 'CREDIT CARD'
    and a.employee_id = nvl(:Emp_id,a.employee_id)
    and a.report_header_id = b.report_header_id
    and cc.trx_id = b.credit_card_trx_id
    and pap.person_id = a.employee_id
    and pap.effective_start_date <= trunc(sysdate)
    and pap.effective_end_date >= trunc(sysdate)
    and k.code_combination_id = b.code_combination_id
    and k.segment2 between nvl(:From_Cost_Center,k.segment2)
    and nvl(:To_Cost_Center,k.segment2)
    and substr(a.invoice_num,1,9) = l.invoice_num
    and substr(c.invoice_num,1,9) = mgr_apprv_lst.user_key
    and substr(c.invoice_num,1,9) = pbl_apprv_lst.user_key

    Hi
    If I understood correctly your logic, and if the columns involved are of type varchar2, you can use the like operator:
    and a.invoice_num like l.invoice_num || '%'
    and c.invoice_num like mgr_apprv_lst.user_key  || '%'
    and c.invoice_num like pbl_apprv_lst.user_key  || '%'In this case, Oracle will be able to use the indexes. If they are numeric, you need to do something like:
    and a.invoice_num between l.invoice_num * 1000000
                                and l.invoice_num * 1000000 + 999999I hope this makes sense...
    Luis

  • 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
    Ashish

    Thanks 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

  • How to convert date in the dashboard prompt

    can anybody tell me how can i conver the date into month year format in the dashboard prompt
    originally i am getting data as a date in the dashboard prompt.i want to change that to MON YYYY format.
    can anybody tell me how can i change the original date format into MMM YYYY format

    hi,
    Try with evaluate function in prompt Fx use the following syntax
    Re: Date function
    Else, EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 30 ), Date."Calendar Date", 'MON-YYYY')
    What you are expecting to be in Prompt was it Mon-2009 right"?
    Thanks,
    Saichand.v

  • Passing Chinese characters in OBIEE 11g GO URL to init the dashboard prompt

    Hi Experts,
    Currently we are using OBIEE 11g and passing the dashboard prompt parameter values through the OBIEE go url. When we are passing English strings the dashboard prompt is initialized with the correct passing value. However for Chinese character it is not. I am using the URLEncoder.encode("parameter value", "UTF-8") encoding to encode the passing string.
    Can anyone tell me what is the wrong in this approach? How can we pass any language strings to OBIEE 11g via go url?
    Thanks

    To avoid encoding problems use POST method. Here is js example for OBIEE 10g, but I bellieve you will find similar XML syntax in 11g.
    function getGoXML(P){
         var goXML = '<sawx:expr xmlns:sawx="com.siebel.analytics.web/expression/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="sawx:logical" op="and">';
         for (var i=0; i<P.length-1; i=i+2){
              goXML = goXML + '<sawx:expr xsi:type="sawx:comparison" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" op="equal">';          
              goXML = goXML + '<sawx:expr xsi:type="sawx:sqlExpression">' + P[i] + '</sawx:expr>';
              goXML = goXML + '<sawx:expr xsi:type="sawx:untypedLiteral">' + P[i+1] + '</sawx:expr>';
              goXML = goXML + '</sawx:expr>';          
         goXML = goXML + '</sawx:expr>';
         return goXML;
    function dashboardPageNav (navParams){     
         var tForm = saw.createForm("customNavForm");
         tForm.action = saw.commandToURL("Dashboard");
         saw.addHiddenInput(tForm, "PortalPath", navParams.portalPath);
         saw.addHiddenInput(tForm, "Page", navParams.portalPage);
         saw.addHiddenInput(tForm, "Action", "Navigate");
         saw.addHiddenInput(tForm, "StateAction", "NewPage");
         saw.addHiddenInput(tForm, "P1", "dashboard");
         saw.addHiddenInput(tForm, "P0", getGoXML(navParams.P));
         tForm.submit();
    dashboardPageNav({
         portalPath: '<portal path>',
         portalPage: '<page name>',
         P: new Array(                         
              '<param1 name>', '<param1 value>',
              '<param2 name>', '<param2 value>',
              '<param3 name>', '<param3 value>',
              '<param4 name>', '<param4 value>'
    });

  • Using presentation variable in a dashboard prompt

    Hi All,
    Can we use a presentation variable set in 1 dashboard prompt in another dashboard prompt to filter the values shown in the prompt based on the value selected in the first prompt?
    I am using SQL results in the second prompt.So, Iam not able to constrain the results. Any ideas?
    Thanks.

    Steps:
    1. 1st Dashboard prompt set Presentation Variable name say pdashboardprompt1
    2. In 2nd Dashboard prompt set Presentation Variable name say pdashboardprompt2
    In SHOW SQL results for 2nd Dashboard prompt. Select constraint
    SELECT Table1.Column1 FROM "SA" WHERE Table1.Column2 = '@{pdashboardprompt1}'

  • SUBSTR function in the where clause

    HI
    I want to get a number of 15 digits from a column where the user only know the last 10 digits.
    So that when the user enter a number with 10 digits, only the record of that specific number should be displayed.
    And then when the user did not enter any number all the records in the table should be displayed.(this part works fine)
    The problem is: when the user enters any last digits( last, second last, thirth last and so on) the records which satisfy this are retrieved, which is not supose to be the case.
    I' am trying to use the substr function in the where clause but I'm not sure if it's working or not becasue the result of the query is just the same as before i used the substr.
    Thanks

    better to pad with '*' me thinks in case u have a number ending with 0's:
      1  select empno,ename
      2  from emp
      3* where empno like '%'||lpad('&1',2,'*')
    SQL> /
    Enter value for 1: 0
    old   3: where empno like '%'||lpad('&1',2,'*')
    new   3: where empno like '%'||lpad('0',2,'*')
    no rows selected
    SQL> /
    Enter value for 1: 00
    old   3: where empno like '%'||lpad('&1',2,'*')
    new   3: where empno like '%'||lpad('00',2,'*')
         EMPNO ENAME
          7900 JAMES
    SQL> /
    Enter value for 1:
    old   3: where empno like '%'||lpad('&1',2,'*')
    new   3: where empno like '%'||lpad('',2,'*')
         EMPNO ENAME
          7369 SMITH
          7499 ALLEN
          7521 WARD
          7566 JONES
          7654 MARTIN
          7698 BLAKE
          7782 CLARK
          7788 SCOTT
          7839 KING
          7844 TURNER
          7876 ADAMS
         EMPNO ENAME
          7900 JAMES
          7902 FORD
          7934 MILLER
    14 rows selected.

  • Using substring function with error

    Hi Guys,
    I have a source field with 1200 characters which need to map to multiple target segments for  132 count of this source field.
    This is not a mandatory field so it sometimes come without any value.
    I am using substring function to breakout the string for every 132 characters and mapped to the target segments.
    There are two problems, first it seems that if source is blank, there will be error.
    Second, if source field come with only eg. 300 characters, error will also occurs.
    I have searched thru SDN and try some of the UDF but to no avail.
    Appreciate your guidance on this problem.
    Regards
    FNG

    H Rahul,
    I have tried your quote but face some syntax error as follows
    Function calculate, Line 6:
    cannot find symbol symbol  : method length() location: class java.lang.String[] j = input.length();       
    Function calculate, Line 26:
    cannot find symbol symbol  : method subString(int,int) location: class java.lang.String[]           
    result.addValue(input.subString(0,EndIndex));                                      ^
    Function calculate, Line 34:
    cannot find symbol symbol  : method subString(int,int) location: class java.lang.String[]                result.addValue(input.subString(StartIndex,EndIndex));                                              ^
    Function calculate, Line 40:
    cannot find symbol symbol  : method subString(int,int) location: class java.lang.String[]                result.addValue(input.subString(StartIndex,EndIndex));                                              ^ Note: /usr/sap/D03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd66a3a60002911e09ba9e41f132d6b68/source/com/sap/xi/tf/_MM_MT_COMS_TO_ZME_CRE_CHG_CONTRACT_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /usr/sap/D03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd66a3a60002911e09ba9e41f132d6b68/source/com/sap/xi/tf/_MM_MT_COMS_TO_ZME_CRE_CHG_CONTRACT_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 4 errors

  • Getting the dashboard prompt value

    Hello,
    I there a way on how can i get the dashboard prompt value when using other operators beside equal/is in. It seems that you can only set a presentation variable using the equal/is in operator.
    Also how can i get prompt value when using multi-select control?

    Hi. Yes, presentation variable is only for is equal to/is in.
    But no need to use other operators ( is less than or equal to, etc) if you want to write data in presentation variable, use equal/is in if you want to show data that is for example less and set presentation variable and in the report instead if IS PROMPTED write advanced SQL filter like:
    TABLE.COLUMN <= '@{pv}'
    You asked also how can to get prompt value when using multi-select control?
    No way to do that. But what do you need that information for. Lets say that you are able to do that and you put multiple values from multi-select into variable, where do you need to present that data? In the report? No need for that because the report is already filtered by it.
    Also check this one:
    Using multiple values row wise session variables in dashboard prompts and requests
    http://108obiee.blogspot.com/2009/10/using-multiple-values-row-wise-session.html
    Regards
    Goran
    http://108obiee.blogspot.com

  • Unnecessary Report refresh on the dashboard when changing the dashboard prompts

    Hello All
    I have two reports on a dashboard with two dashboard prompts for example Report 1) Year, State, Count; Filter: Year is prompted 2) Year, State, Count; FIlter: State is prompted. On the dashboard we have two reports Report1) and Report 2) with Year and State dashboard prompts.
    The issue is when you change year prompt both the reports gets refreshed even though nothing changes on report 2 but it still dissapears and appears as it is refreshing and  the same happens with report 1 when i change the state prompt it refreshes that report.
    Please letme know how i can limit the dashboard prompt to refresh only the report where it is prompted.
    Thanks
    Ravi

    are you talking about the database table caching? if so we are using OLAP cubes and I am not sure if caching is disabled. Is my issue related to caching? also another updated if I have just one dashboard prompt for example just year  only report 1 refreshes and the report 2 doesn't disappear. But when I add state dashboard prompt, which ever prompt I change state or year  both reports refreshes. The problem is when I add more than one prompt on the dashboard all the reports refreshes when the dashboard prompt selection changes. Any ideas.
    Thanks

  • How to realize this reqirement in the dashboard prompt in OBIEE 10G?

    Hi,
    I have a new query about dashboard prompt in OBIEE 10g..
    All below is needed to Operator in the dashboard prompt.
    We have 4 columns, 4 columns using multi-select type need to constrain together and need to show value which is related with product..
    e.g.
    Now I display "REGION" column using multi-select in Control, and I need to show data which product name is not null. After I add "where product name is not null" in the SQL results in Show, then I cannot use the Constrain box.. and I cannot set any variable if I using multi-select type..
    So anybody have any idea about this?
    Your reply will be highly appreciate..
    Regards,
    Anne

    Hi Anne
    User Input type as " Multi select prompt" keep it with constrain option then apply below query
    apply like this kind of SQL query in Default selection --->SQL result section
    SELECT "MX_PORTFOLIO_STATIC"."MT_BU_Level1" FROM "Position" where "MX_PORTFOLIO_STATIC"."MT_BU_Level1" is not null
    Thanks
    Deva

  • How  to get the value of multi-select in the   Dashboard Prompt

    I have a multi-select prompt in the Dashboard Prompt,  what I want is,   how do I know that user has choose one value,
    for examle,  for some reasons,  if user didn't choose any value,  then I will set one column in answer as "customer office" , if user choose one value, then the column in answer will be "customer name". 
    any comments, thanks.

    Hi,
    first define the presentation variable for the required column prompt. ex: PV
    Then in report level set the filter for that column = @{PV}{customer office}. here u have to give default value as "customer office", so by default the report in dashboard will show customer office even though the user does not select any value from dashboard prompt.
    Mark If Helpful/correct.
    Thanks.

  • How to use SQL functions in the queries

    hey guys i wanna know how to use SQL functions in the queries is it possible or not .

    Hi,
    Wat exactly that set values are?
    those from sql query?
    How to use count():
    The COUNT() function returns the number of rows that matches a specified criteria.
    SQL COUNT(column_name) Syntax
    The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
    SELECT COUNT(column_name) FROM table_name
    SQL COUNT(*) Syntax
    The COUNT(*) function returns the number of records in a table:
    SELECT COUNT(*) FROM table_name
    SQL COUNT(DISTINCT column_name) Syntax
    The COUNT(DISTINCT column_name) function returns the number of distinct values of the specified column:
    SELECT COUNT(DISTINCT column_name) FROM table_name
    The IN function helps reduce the need to use multiple OR conditions.
    The syntax for the IN function is:
    SELECT columns
    FROM tables
    WHERE column1 in (value1, value2, .... value_n);

Maybe you are looking for