Redirect to different pages based on user input value

Hello,
Anyone please help.
I am trying to redirect to different pages based on user inputs. I have a form in which I have one text item and a submit button. For example consider text item to be empno; So once the user enters a empno and hits submit button; I need to redirect to different pages based on this job.
For Ex: if user inputs empno whose job is 'ANALYST' then redirect to page 1
if user inputs empno whose job is 'MANAGER' then redirect to page 10
For this scenario. i wrote a pl/sql process for the submit button; but no luck -- its not at all redirecting instead its in the same page. Below is the process.
declare
v_job varchar2(20);
begin
select job into v_job from emp where empno = :P9_EMPNO_R;
if v_job = 'ANALYST' then
OWA_UTIL.REDIRECT_URL('f?p=&APP_ID.:1:&SESSION.::&DEBUG.::', TRUE);
end if;
if v_job = 'MANAGER' then
OWA_UTIL.REDIRECT_URL('f?p=&APP_ID.:10:&SESSION.::&DEBUG.::', TRUE);
end if;
end;Please help. I am using Oracle APEX version 4.2 and database Oracle 11g R2
Thanks,
Orton

orton607 wrote:
Hello,
Anyone please help.
I am trying to redirect to different pages based on user inputs. I have a form in which I have one text item and a submit button. For example consider text item to be empno; So once the user enters a empno and hits submit button; I need to redirect to different pages based on this job.
For Ex: if user inputs empno whose job is 'ANALYST' then redirect to page 1
if user inputs empno whose job is 'MANAGER' then redirect to page 10
For this scenario. i wrote a pl/sql process for the submit button; but no luck -- its not at all redirecting instead its in the same page. Below is the process.
declare
v_job varchar2(20);
begin
select job into v_job from emp where empno = :P9_EMPNO_R;
if v_job = 'ANALYST' then
OWA_UTIL.REDIRECT_URL('f?p=&APP_ID.:1:&SESSION.::&DEBUG.::', TRUE);
end if;
if v_job = 'MANAGER' then
OWA_UTIL.REDIRECT_URL('f?p=&APP_ID.:10:&SESSION.::&DEBUG.::', TRUE);
end if;
end;Please help. I am using Oracle APEX version 4.2 and database Oracle 11g R2
Thanks,
OrtonI have a similar scenario in my application and this is how I handle it.
1. Create a page item on the page, say Px_PAGE_NUM
2. Create a "On Submit - After Computations and Validations" page process to set the above page item. In your case, you can use the same logic that you have already in place (except the call to OWA_UTIL.REDIRECT_URL) :
declare
v_job varchar2(20);
begin
select job into v_job from emp where empno = :P9_EMPNO_R;
if v_job = 'ANALYST' then
   :Px_PAGE_NUM := '1';
end if;
if v_job = 'MANAGER' then
   :Px_PAGE_NUM := '10';
end if;
end;3. Create a "On Submit: After processing" branch. Specify the "Target Type" as "Page in the application" and "Page Number" as &Px_PAGE_NUM. (with the dot).
I hope the above helps.
BTW, the following thread in the forum related to OWA_UTIL.REDIRECT_URL might help:
issue OWA_UTIL.REDIRECT_URL with APEX 4.1.1

Similar Messages

  • Redirecting to different pages based on value from table linked from report

    Hi,
    I wanted to navigate to different pages from a report link based on a value from the table on which the report is built. I was able to link to particular page without any problem.
    But, I wanted to link to different pages based on value in the table. Please let me know how can I do this?
    Thanks,

    kaminey wrote:
    Hi,
    I wanted to navigate to different pages from a report link based on a value from the table on which the report is built. I was able to link to particular page without any problem.
    But, I wanted to link to different pages based on value in the table. Please let me know how can I do this?APEX version?
    Is this a standard or interactive report?
    How does the value from the table determine the target page used in the link? Is it a page number? Or the result of some computation or process?
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.

  • Displaying different reports based on user input.

    Hi,
    I have a requirement to display the invoiced amount and Ago amount on a dashboard. The ago amount will be dynamic in that if user selects the prompt 'compare with' as previous day, it should display day ago amount along with todays amount. It he chooses month, then it should display this month's amount and previous month's amount.
    Is there a way I can achieve this on a dashboard?
    Thanks,
    Vivek.

    Use guided navigation. And you need to have 2 reports (one for day level and the other for month level, eac has own AGO part). And some reports for guided navigation conditions.
    Regards
    Goran
    http://108obiee.blogspot.com

  • How to redirect to different page after login in APEX 4.1

    Dear All,
    Here my Requirement is,When the users login,
    when they entered their username and password and pressed login button,
    they have to redirected to different pages based on the type of user.
    Here my LOGIN_TABLE has following 3 columns,
    1.Username
    2.Password
    3.Type.
    The TYPE has 2 values, employee and admin.
    when the type is admin they should be redirected to page 2,
    reaining i.e employee users has to be redirected to page 3.
    How can I do this? please give some suggestion.
    Thank you.
    regards,
    Gurujothi

    Dear Christian,
    Thank you for your reply,
    I would like to explain something,
    When I using the following function,
    *create or replace FUNCTION custom_auth_g (
    p_username IN VARCHAR2,
    p_password IN VARCHAR2)
    RETURN BOOLEAN IS
    BEGIN
    FOR c1 IN (SELECT 1
    FROM login_table
    WHERE upper(username) = upper(p_username)
    AND upper(password) = upper(p_password))
    LOOP
    RETURN TRUE;
    END LOOP;
    RETURN FALSE;
    END;*
    When login, It checks in the login_table table and if the username is exist with the pass word it successfully entered inside the application.
    for all users only one page which we set.
    My Login_table also contains type which has 2 type as I mentined above.
    But As I mentioned earliar based on the user type it has to be redirected to 2 different page.
    I found this Package but I cant understand,Can you please Explain?
    *create or replace PACKAGE app_security_pkg
    AS
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    FUNCTION get_hash
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN VARCHAR2;
    PROCEDURE valid_user2
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    FUNCTION valid_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN BOOLEAN;
    END app_security_pkg;*
    *create or replace PACKAGE BODY app_security_pkg
    AS
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    IS
    lv_goto_page NUMBER DEFAULT 1;
    BEGIN
    -- This logic is a demonstration of how to redirect
    -- to different pages depending on who successfully
    -- authenticates. In my example, it simply demonstrates
    -- the ADMIN user going to page 1 and all other users going
    -- to page 2. Add you own logic here to detrmin which page
    -- a user should be directed to post authentication.
    IF UPPER(p_uname) = 'ADMIN'
    THEN
    lv_goto_page := 1;
    ELSE
    lv_goto_page := 2;
    END IF;
    APEX_UTIL.SET_SESSION_STATE('FSP_AFTER_LOGIN_URL');
    wwv_flow_custom_auth_std.login
    p_uname => p_uname,
    p_password => p_password,
    p_session_id => p_session_id,
    p_flow_page => p_flow_page || ':' || lv_goto_page
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE;
    END login;
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    AS
    BEGIN
    INSERT INTO app_users (username, PASSWORD)
    VALUES (UPPER (p_username),
    get_hash (TRIM (p_username), p_password));
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    ROLLBACK;
    RAISE;
    END add_user;
    -- Function to Perform a oneway hash of the users
    -- passwords. This cannot be reversed. This exmaple
    -- is a very week hash and if been used on a production
    -- system, you may want to use a stronger hash algorithm.
    -- Read the Documentation for more info on DBMS_CRYPTO as
    -- this is the supported package from Oracle and
    -- DBMS_OBFUSCATION_TOOLKIT is now depricated.
    FUNCTION get_hash (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN VARCHAR2
    AS
    BEGIN
    RETURN DBMS_OBFUSCATION_TOOLKIT.md5 (
    input_string => UPPER (p_username)
    || '/'
    || UPPER (p_password));
    END get_hash;
    PROCEDURE valid_user2 (p_username IN VARCHAR2, p_password IN VARCHAR2)
    AS
    v_dummy VARCHAR2 (1);
    BEGIN
    SELECT '1'
    INTO v_dummy
    FROM app_users
    WHERE UPPER (username) = UPPER (p_username)
    AND PASSWORD = get_hash (p_username, p_password);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN raise_application_error (-20000, 'Invalid username / password.');
    END valid_user2;
    FUNCTION valid_user (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN BOOLEAN
    AS
    BEGIN
    valid_user2 (UPPER (p_username), p_password);
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS
    THEN RETURN FALSE;
    END valid_user;
    END app_security_pkg;*
    And you said "assign an URL to FSP_AFTER_LOGIN_URL, depending on the Type column",
    Where to assign,Could you please Explain?
    Thank you.

  • Query Based On User Input

    Hello,
    Is there a way that I can get Discoverer to run different queries based on user input? In other words, I have two parameters "A" and "B". If the user enters a value for "A", execute QUERY1. If the user enters a value for "B", execute QUERY2. If both parameters are left blank, execute QUERY3. If the user enters values for "A" and "B", execute QUERY4.
    I'm fairly new to Discoverer so any help that I can receive on this matter will be greatly appreciated.
    Thank You

    Denes Kubicek wrote:
    I think this example shows something similar:
    https://apex.oracle.com/pls/apex/f?p=31517:91
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------I see there is executing stored queries example, and text area showing executed one, but not quite understand how to sent sql-query directly from text input, based on your example :/

  • Redirect user to a different Page based on number of  Liquid output result

    I want to redirect the user to a different page based on the number of results. I have some multi-account users and single account user in my secure zone. I want single account users to be sent to a different page, while multiple account user should be shown their accounts and they user can now click the account he/she wants to access. This is my code:
    {module_data resource="customers" fields="company, email1"  where="\{'company':\{'$contains':'{{this.globals.user.email}}'\}\}" skip="0" limit="500"  version="v3" collection="companyXtra" template=""}
    {module_webapps id="21927" filter="all" collection="companyAccess" template=""}
    {% for item in companyAccess.items -%}
    {% assign counter = {{forloop.length}} -%}
    {% if globals.user.email = item.email and counter = 1 -%}
    <script>
    window.location.replace("/single-account-user.html");
    </script>
    <a class="w-inline-block szone-navlinks multiplecoy" href="{{item.url}}">
        <div class="szone-holder">
          <div class="szone-narrate addenrolee">{{item.name}}</div>
        </div>
      </a>
    {% else %}
    <p><a href="{{item.url}}">{{item.name}}</a></p>
    {% endif %}
    {% endfor %}
    </div>
    Please what I'm doing wrongly. Can someone kindly assist. Thanks.

    Hi Liam I have since been reviewing my query using the BC API Discovery which has been a good guide for me. But the result is just displaying the core customer's company, though the other company has a default email/email1 as the core customer.
    This is my new query:
    {module_data resource="customers" version="v3" fields="company" skip="0" limit="10" where="\{'email1.value':\{'$contains':'{{globals.user.email}}'\}\}" order="id" collection="myData"}
    <pre>{{myData|json}}</pre>
    This is the json:
      "moduleName": "data",
      "moduleDescriptor": {
      "templatePath": null,
      "parameters": "resource=\"customers\",version=\"v3\",fields=\"company\",skip=\"0\",limit=\"10\",where=\ "\\{'email1.value':\\{'$contains':'[email protected]'\\}\\}\",order=\"id\",collection=\"myData\"",
      "apiEndpoint": "/api/v3/data",
      "objectType": "-1",
      "objectId": "-1",
      "adminUrl": ""
      "items": [
      "company": "The vivove company Limited"
      "totalItemsCount": 1,
      "skip": 0,
      "limit": 10,
      "params": {
      "resource": "customers",
      "version": "v3",
      "fields": "company",
      "skip": "0",
      "limit": "10",
      "where": "\{'email1.value':\{'$contains':'[email protected]'\}\}",
      "order": "id",
      "collection": "myData"
    I expected to see two companies. This is screenshot of my the companies in the CRM:
    Screenshot by Lightshot
    Screenshot by Lightshot
    Thanks. most appreciated.

  • How to configure the schema name dynamically based on user input.

    configure the schema name dynamically based on user input.
    For ex:
    We have two schemas:
    Schema1  - base schema having 15 tables.
    Schema2 -  tables which is specific to modules. Having only 10 tables which is also available in Schema1
    Login to application using Schema 1
    Access a particlular module and select the country. Here country selection is identified.
    Based on the country selection, we need to connect the schema respectively.
    If the user selects France --> It should connect Schema1
    If the user selects Germeny --> It should connect schema2.
    Used: Eclipselink

    You may want to have a different persistence unit for each country, then you just need to switch persistence units, and can put the schema in your orm.xml file.
    You may also want to investigate EclipseLink multi-tenant support,
    http://www.eclipse.org/eclipselink/documentation/2.5/jpa/extensions/a_multitenant.htm
    You can the schema in a persistence unit in code using a SessionCustomizer and the tableQualifier.

  • Generate charts based on user input

    Hello!
    My goal is to create an application in which a user would enter information (specifically in the form of numbers and financials). The final output would create a page / document that shows summary of the data and also manipulates the data into bar and pie charts. (We are trying to create side by side comparison charts based on user input.)
    I have a subscription to the Creative Cloud, so I have access to a large % of Adobe products. Do you have any suggestions on what application I should use for this project? The final output could be PDF or Web based.
    Thank you!
    Bethany

    Hi Bethany,
    You may check out Adobe FormsCentral at https://www.acrobat.com/formscentral/en/home.html and see if that's what you need. You can create forms using Adobe FormsCentral to collect user input and user responses will be displayed in charts.
    Thanks,
    Wenlan

  • Derive values based upon user input

    Hello,
    I recieved a request for a report.
    When a user runs the report they are to be prompted for a fiscal year/period.
    Based on the fiscal year/period that the user provides I have the following columns  (in bold below are 2 examples that may make the description more clear).
    1. Revenue for the Fiscal year Prior to the fiscal year of the user input value
    2. Revenue for the Fiscal year/Period prior to the input Fiscal year/period
    3. Revenue for the Year to date accumulation up to the prior fiscal year/period that the user input
    4. Revenue for the Year to date accumulation up to the prior fiscal year (fiscal year rolls back first) and prior period (for period 01, it then rolls back the fiscal year 1 more year) that the user input
    Example 1: If the user ran the query and they provided the value 05/2007, then the values that need to be obtained would be:
    1. Revenue for 2006
    2. Revenue for 04/2007
    3. Revenue for 01/2007 to 04/2007
    4. Revenue for 01/2006 to 04/2006
    Example 2: If the user ran the query and they provided the value 01/2008, then the values that need to be obtained would be:
    1. Revenue for 2007
    2. Revenue for 12/2007
    3. Revenue for 01/2007 to 12/2007
    4. Revenue for 01/2006 to 12/2006
    Please help me with determining how to obtain the user input value, and then how to derive the time periods for the columns based upon that value.
    Thanks,
    Nick
    (points available)
    Edited by: Nick Bertz on Mar 13, 2008 9:43 AM

    Hello,
    See my example.. I am reading the value from Keydate Variable
    WHEN ZVND01
            READ TABLE i_t_var_range INTO w_var_range WITH KEY vnam = 'Keydate'.
             IF SY-SUBRC = 0.
              CLEAR l_s_range.
              l_date = w_var_range-low.
              concatenate l_date(6) '01' into l_first_date.
              CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
              EXPORTING
                        day_in = l_date
              IMPORTING
                         last_day_of_month = l_last_date
              EXCEPTIONS
                        day_in_not_valid = 1
                        OTHERS = 2.
              IF sy-subrc EQ 0.
                l_s_range-low  = l_first_date.
                l_s_range-high = l_last_date.
                l_s_range-sign = k_sign_inclusive.
                l_s_range-opt  = k_option_between.
                APPEND l_s_range TO e_t_range.
              ENDIF.
    Hope this example helps..

  • How to add column dynamically based on user input in oracle?

    **how to add column dynamically based on user input in oracle?**
    I am generating monthly report based on from_date to to_date below is my requirement sample table
    EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE | 01-OCT-12 | 02-OCT-12 | 03-OCT-12
    100001.............John...........02-OCT-12...............6
    100002.............chris...........01-OCT-12...............4
    Based on user input, that is, if user need the report from 01-OCT-12 TO 03-OCT-12, i need to add that dates as column in my table, like 01-OCT-12 | 02-OCT-12 | 03-OCT-12....
    below is my code
    create or replace
    procedure MONTHLY_LVE_NEW_REPORT_demo
    L_BUSINESS_UNIT IN SSHRMS_LEAVE_REQUEST_TRN.BUSINESS_UNIT%TYPE,
    --L_LEAVE_TYPE_CODE           IN SSHRMS_LEAVE_REQUEST_TRN.LEAVE_TYPE_CODE%TYPE,
    L_DEPARTMENT_CODE IN VARCHAR2,
    --L_MONTH                    IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
    L_FROM_DATE IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
    L_TO_DATE in SSHRMS_LEAVE_REQUEST_TRN.LVE_TO_DATE%type,
    MONTHRPT_CURSOR OUT SYS_REFCURSOR
    AS
    O_MONTHRPT_CURSOR_RPT clob;
    v_return_msg clob;
    BEGIN
    IF (L_BUSINESS_UNIT IS NOT NULL
    AND L_FROM_DATE IS NOT NULL
    and L_TO_DATE is not null
    -- AND L_DEPARTMENT_CODE IS NOT NULL
    THEN
    OPEN MONTHRPT_CURSOR FOR
    select EMPLOYEE_CODE, EMPLOYEE_NAME AS NAME, DEPARTMENT_CODE AS DEPARTMENT,DEPARTMENT_DESC, CREATED_DATE,
    NVL(WM_CONCAT(CL_RANGE),'') as CL_TAKEN_DATE,
    case when NVL(SUM(CL2),0)<0 then 0 else (NVL(SUM(CL2),0)) end as CL_BALANCE,
    from
    SELECT DISTINCT a.employee_code,
    a.EMPLOYEE_FIRST_NAME || ' ' || a.EMPLOYEE_LAST_NAME as EMPLOYEE_NAME,
    a.DEPARTMENT_CODE,
    a.DEPARTMENT_DESC,
    B.LEAVE_TYPE_CODE,
    B.LVE_UNITS_APPLIED,
    B.CREATED_DATE as CREATED_DATE,
    DECODE(b.leave_type_code,'CL',SSHRMS_LVE_BUSINESSDAY(L_BUSINESS_UNIT,to_char(b.lve_from_date,'mm/dd/yyyy'), to_char(b.lve_to_date,'mm/dd/yyyy'))) CL_RANGE,
    DECODE(B.LEAVE_TYPE_CODE,'CL',B.LVE_UNITS_APPLIED)CL1,
    b.status
    from SSHRMS_EMPLOYEE_DATA a
    join
    SSHRMS_LEAVE_BALANCE C
    on a.EMPLOYEE_CODE = C.EMPLOYEE_CODE
    and C.STATUS = 'Y'
    left join
    SSHRMS_LEAVE_REQUEST_TRN B
    on
    B.EMPLOYEE_CODE=C.EMPLOYEE_CODE
    and c.EMPLOYEE_CODE = b.EMPLOYEE_CODE
    and B.LEAVE_TYPE_CODE = C.LEAVE_TYPE_CODE
    and B.STATUS in ('A','P','C')
    and (B.LVE_FROM_DATE >= TO_DATE(L_FROM_DATE, 'DD/MON/RRRR')
    and B.LVE_TO_DATE <= TO_DATE(L_TO_DATE, 'DD/MON/RRRR'))
    join
    SSHRMS_LEAVE_REQUEST_TRN D
    on a.EMPLOYEE_CODE = D.EMPLOYEE_CODE
    and D.LEAVE_TYPE_CODE in ('CL')
    AND D.LEAVE_TYPE_CODE IS NOT NULL
    group by EMPLOYEE_CODE, EMPLOYEE_NAME, DEPARTMENT_CODE, DEPARTMENT_DESC, CREATED_DATE
    else
    v_return_msg:='Field should not be empty';
    end if;
    END;
    my code actual output
    EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE
    100001....................John............02-OCT-12.................6
    100001....................chris...........01-OCT-12.................4
    how to add column dynamically based on from_date to to_date?
    Thanks and Regards,
    Chris Jerome.

    You cannot add columns dynamically. But you can define a maximum number of numbers and then hide unused columns in your form useing SET_ITEM_PROPERTY(..,VISIBLE, PROPERTY_FALSE);

  • Drawing a line of asterisks based on user input - where do I start?

    Greetings,
    I'm trying to write an application that will ask the user for a number then the program will output that number in a line of asterisks based on user input - where do I start?
    I really appreciate any informaiton.

    import javax.swing.*;
    public class numbers {
         public static void main ( String args[])
              String strNumber;
              int number = 0;     
              strNumber = "";
         for (int num1 = 0; num1<=5; num1++)
                   strNumber = JOptionPane.showInputDialog ("How many Asterisks do you want printed?");
                   number = Integer.parseInt(strNumber);
              for(int num=0; num<number; num++) System.out.print("*");
                   System.out.println("");
              System.exit(0);
                        }This compiles fine, but it just keep rewriting the same thing... Any suggestions would be greatl appreciated. Also, how would I be able to confine the number entered to under 30?
    THanks

  • Displaying columns based on User Input

    Hi,
    I have a following requirement :
    I have four columns in a report : Performance Indicator ,Target (XTD) , Actual (XTD),Indicator(Traffic Lights)
    Based on the prompt, which contains column named as "Review Frequency" having values as 1. Monthly 2. Quaterly 3. Yearly.
    When User select "Monthly" in pormpt I want to see MTD in Actual and Target column and Indicator depending on these columns.
    When User select "Quaterly" in pormpt I want to see QTD in Actual and Target column and Indicator depending on these columns.
    Can anybody tell me how can we achieve this?
    I think I can achieve this with guided navigation but for that I have to create 3 reports.
    Can anybody have any better idea to create just one report and based on user input I can show/hide columns in a single report?
    This is mainly related to Balanced ScoreCard.
    Thanks in advance
    Regards,
    Vikas

    you have seperate columns for monthly, quarterly, and yearly, right?
    In the prompt, save the "Review Frequency" as a Presentation Variable "abc";
    In the request, you add actual (MTD) column, edit the formula, use something like:
    CASE
    WHEN @{abc}='Monthly' THEN "- SalesFacts"."actual (MTD)"
    WHEN @{abc}='Quarterly' THEN "- SalesFacts"."actual (QTD)"
    ELSE "- SalesFacts"."actual (YTD)"
    END
    then do the same thing for target column.

  • Excel Macro to Delete rows based on user input

    I need help creating a macro that will delete rows in a spreadsheet based on user input. Have little to no experience writing macros.
    Rows are distinguished based on codes in column B, so if the user types "6657", the row with code 6657 should be deleted. Any help would be much appreciated

    Hi,
    Please try the macro:
    Sub Sample()
    Dim Ret As Long
    Ret = Application.InputBox(Prompt:="Please enter a row number", Type:=1)
    If Ret = False Then Exit Sub
    With ActiveSheet
    .Rows(Ret).Delete Shift:=xlUp
    End With
    End Sub
    If you have further question about the VBA code, please post your question to the MSDN forum for Excel
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    George Zhao
    TechNet Community Support

  • Displaying alert message based on user input on input param screen

    Hi,
    Based on user input I wish to display an alert popup on my report. I
    have provided the user 2 dropdowns called sortasc and sortdesc with all
    the column names used in the report to simulate dynamic sorting.This is
    because we do not have dynamic sorting in CR XI R2. When the user
    selects same column name in both sortasc and sortdesc then the sort
    type which has priority in the record sort expert is executed. This is fine but we want an alert
    or message popup displayed so as to prevent user from selecting same
    column names.
    I tried adding an alert with the following code:
    if {?sortasc} = {?sortdesc} then true else false
    So far I have not been prompted with any alert message box.
    Let me know if there is any other option.

    Hi Shalu,
    I have created a alert and it is working fine, please follow the steps
    Create a new Alert using two static parameters and give the condition for message like :
    if {?Myworld} = {?Myworld1} Then
    'You have entered a correct word'
    else
    'This is not a correct word'
    Then create a condition like :
    {?Myworld} = {?Myworld1} or {?Myworld} <> {?Myworld1}
    Also check the check box Enabled and save the alert.  Now it will popup if the myworld is equal to myworld1 or myworld is not equal to myworld1.
    Hope this will help you
    Thanks,
    Sastry

  • Key figure value based on user input.

    Dear Friends,
    We are using BI7.00 and NW2004S. In one of our report to monitor the number of notification closed and the number of notification open upto the user selected month. For this i have created a Query which has selection screen value as month. I have created a condition which will fetch the difference in days (notification completion - notification creation date) based on user entered value.  For example if user enters 10 in the selection screen, report will fetch the notifications which have diffrence in days as 10.
    The condition is okay for the above. What user actually wants is the number of notifications completed and that pending based on the value he enters in the screen. For example he enters 10 in the screen, system should show the values as shown below
                    > 10 days    
    Completed                Pending
              3                           2 
    I tried various options but could not achieve this.
    Experts help expected. Kindly provide solution.
    Regards,
    M.M

    Hi,
    As per my understanding 1 firstly u have to find out
    the no of days (diff between dates notification completion, notification creation date .)
    then u have to create condition on no of days which u
    have find.there u have to create one user entry
    variable for the user can enter his own parametrs.
    Right?????
    If It is right..
    here are the steps..
    1st:in the query designer at key figure coloumn create
    one local formula.in that local formula create formula
    variable with replacement path.in that take reference character
    notification completion.in the next tab take replace ment
    as key.in the last tab select "date".
    2nd: do the same thing for the notification creation date.
    3 rd : create 3 rd local formula and do the substraction
    for the first 2 local formulas.
    4th:create codition on the difference which u have find with
    on that condition u can create one user entry varibale.
    5th:while u defining the query put these 2 dates,i,e
    notification completion, notification creation date in the character block.
    If not system will ignore the formula variable which u created in
    above steps.
    Hope this wil help u.
    regards....KP

Maybe you are looking for