Can formula column values be used as parameters

Post Author: vdm
CA Forum: Formula
Hi,
I have various formula columns setup in my crystal report, these formula columns act as prompts when end users run the report. i am using crystal reports xi and sql server databse.
Now I would like to use these formula columns to restrict my result set. basically, these should act as predicates (where clauses) to my query.
Is there a way to pass formula columns as parameters to stored procedures or to commands or to simpy add them to a sql query ?
thanks in advance

Post Author: foghat
CA Forum: Formula
Have you tried adding the formula fields as a filter in the Record Selection Formula editor?So  Report --> Selection Formulas --> Recordand add: {database.field_a} = and {database.field_b} = and so on 

Similar Messages

  • Can be passed Formula Column value to Procedure/Function?

    Below cf_value is return after some calculation by using main query.
    Can be directly passed formula column value to procedure without assinged to placeorder?
    as below..
    f_convert(:cf_value,new_value);
    My Procedure is...
    PROCEDURE f_convert( val1 in number,val2 in out number) IS
    BEGIN
    val2 := val1 * 100;
    END;
    If anyone knows pls reply me....

    Actually, if there is any other calculations there (In Proceudre)
    Can I used is as below??
    PROCEDURE f_convert( val1 in number,val2 in out number) IS
    BEGIN
    val2 := val1 * 100;
    return (val2);
    END;
    ----A procedure cannot return a value, the return clause in my previous post was part of the function for formula column.
    Suppose you have a formula column say CF_2 then the function for it will be as:
    function cf_2formula return number
    is
    val1 number;
    val2 number;
    begin
    val2 := :cf_1 * 100; -- or val2 := val1 * 100 --parameters not allowed in formula column function
    -- All the other code that you need inclusive of calling function, procedure as in any PL/SQL block can be placed
    return (val2);
    end;So any other calculation can be used in the formula column function

  • Report output order by formula column value? pls.urgent

    hi.
    i have one query select empno,ename, sal from emp. in report layout i created a formula column named as net_sal(in which am doing some calculation based on some criteria). now i want to print the report order by net_sal desc.
    how can i solve it? since the calculation is being done on runtime only/
    pls. help me. urgent

    Puedes hacer lo sigte.:
    En el SQL QUERY STAMENT
    select empno, ename, sal, :net_sal
    from emp
    order by 4 asc/desc

  • Changing Column Value Style using SQL Query

    Hi,
    I'm trying to build a fantasy basketball game with APEX. I have a table that has a list of games. I need to change the color of the column value i.e. the name of the team that wins according to a SQL query Here's an example:
    TABLE NAME: LATESTGAMES
    Home Away Homepoints Awaypoints
    Boston Cleveland 105 101
    Toronto Washington 122 83
    What I want to do is display the winning team i.e. Boston and Toronto in Green since that's the team that won.
    The SQL query is:
    SELECT HOME,
    AWAY,
    HOMEPOINTS,
    AWAYPOINTS
    from LATESTGAMES;
    What do I need to do in order to display the Winning Team as Green on every column? Please Help

    Hello Devilfish,
    I did something like that in my DG Tournament application (http://www.dgtournament.com)
    Your SQL query can look like this:
    SELECT CASE
              WHEN (homepoints > awaypoints)
                 THEN '<span style="color:green;">' || home || '</span>'
              ELSE home
           END AS home,
    SELECT CASE
              WHEN (awaypoints > homepoints)
                 THEN '<span style="color:green;">' || away|| '</span>'
              ELSE away
           END AS away,
    HOMEPOINTS,
    AWAYPOINTS
    from LATESTGAMES;Hope that gives you an idea,
    Dimitri
    -- http://dgielis.blogspot.com
    -- http://apex-evangelists.com

  • Formula column value not updating in table?

    Hi all,
    I create the sample for master/detail form. In detail for prdcode,rate,qty,amount is there. When select prdcode it fetching prdcode,rate in a record and if you type the qty the amout will come based on formula(property) :qty*:rate.
    It is available on screen. But when i store the data, in backend table the amount is be a null.
    What is the problem.
    Help me in this regards,
    kanish

    Hi kanish
    Regarding Nul...
    -u have to make sure that the formula is working fine and displaying the result in the form screen
    -then the item u r storing MUST be a db item >yes and has a column name
    -first of all select Help > display_error in the forms runtime may a db item error arais and the record is not correctly saved as u imagined.
    u have 2 choices for the solution , i had both before may be it's not very cute but it will work...
    1. In when-validate-item Trigger or related item triggers pls follow
    SELECT Nvl(( :qty*:rate ) ,0)
    INTO :UR_ITEM
    FROM DUAL;2.In Pre-Update,Pre-Insert & Pre-Delete Triggers Pls assign the result of ur formula column to the item u want to calc as supposing u r doing the calc of formula in non-db item , then put the following in triggers mentioned ...
    : item_name :=:qty*:rate;Hope this helps...
    Regards,
    Amatu Allah.

  • How can query the table MARD using the parameters

    Hi,
    I have inputs as material number , sales organization , distribution chanel and plant , using this i have query the table MARD . in MARD table material number and plant is available , how can i relate sales organization and distribution chanel to query the table, please help.
    Regards,
    Ratheesh

    Hi,
    MVKE table contains the relationship between material, sales org. and distribution channel.
    You can hence create a join between MARD and MVKE tables and create a query.
    Regards,
    Aditya

  • Column Values based on different parameters

    Hi Gurus,
    I have to create a report which has the caluculate #of installes, #of orders, # Completed on perticular date range in single report (kind a dashboard).
    The # of installs need to calculated based on Install date range based on Installed date, #of orders need to calculated in Order date range based on order date and # of Completed on Completed date.
    Could you please help me how to create for this kind of situation.
    example: for last 10 days the number of Installs are 10 and orders are 20 and completed is 5.
    can i create report like this
    Division | Region | Intalls | orders |completed
    filter
    install date between last 10 days or
    order date between last 10 days or
    completed date between last 10 days.
    or in need to create the combined request.
    Thanks in advance
    Regards
    Ali

    Hi Ali,
    As per your requirement, you suppose create a view like
    select division,region.sum(installs),sum(orders),sum(completed),aging from
    (select division,region, sum(installs) installs, 0 orders,o completed, case when timestampdiff(SQL_TSI_DAY,tablename.install_date,current_date) between 0 and 10 then 'Less than 10 Days'
    when timestampdiff(SQL_TSI_DAY,tablename.install_date,current_date) between 11 and 25 then '10-25 Days'
    else '> 25 Days' end Aging
    group by division,region,case when timestampdiff(SQL_TSI_DAY,tablename.install_date,current_date) between 0 and 10 then 'Less than 10 Days'
    when timestampdiff(SQL_TSI_DAY,tablename.install_date,current_date) between 11 and 25 then '10-25 Days'
    else '> 25 Days' end
    union all
    select division,region, 0 installs, sum(orders) orders,o completed, case when timestampdiff(SQL_TSI_DAY,tablename.order_date,current_date) between 0 and 10 then 'Less than 10 Days'
    when timestampdiff(SQL_TSI_DAY,tablename.order_date,current_date) between 11 and 25 then '10-25 Days'
    else '> 25 Days' end Aging
    group by division,region,case when timestampdiff(SQL_TSI_DAY,tablename.order_date,current_date) between 0 and 10 then 'Less than 10 Days'
    when timestampdiff(SQL_TSI_DAY,tablename.order_date,current_date) between 11 and 25 then '10-25 Days'
    else '> 25 Days' end
    union all
    select division,region, 0 installs, 0 orders,sum(completed) completed, case when timestampdiff(SQL_TSI_DAY,tablename.completed_date,current_date) between 0 and 10 then 'Less than 10 Days'
    when timestampdiff(SQL_TSI_DAY,tablename.completed_date,current_date) between 11 and 25 then '10-25 Days'
    else '> 25 Days' end Aging
    group by division,region,case when timestampdiff(SQL_TSI_DAY,tablename.completed_date,current_date) between 0 and 10 then 'Less than 10 Days'
    when timestampdiff(SQL_TSI_DAY,tablename.completed_date,current_date) between 11 and 25 then '10-25 Days'
    else '> 25 Days' end
    group by division,region,aging
    *(Note : Create aging based on your requirement)*
    create a dashboard prompt on Aging
    hope u understand....
    Cheers,
    Aravind

  • How to Update the oracle toad column value in table by using SSRS 2008

    Hi Team,
    How to update the oracle DB table column value by using SSRS 2008.
    Can any one help me on this.
    Thanks,
    Manasa.
    Thank You, Manasa.V

    Hi veerapaneni,
    According to your description, you want to use SSRS to update data in database table. Right?
    Though Reporting Services is mostly used for rendering data, your requirement is still can be achieved technically. You need to create a really complicated stored procedure. Pass insert/delete/update and the columns we need to insert/delete/update as
    parameters into the stored procedure. When we click "View Report", the stored procedure will execute so that we can execute insert/delete/update inside of the stored procedure. Please take a reference to two related articles below:
    Update Tables with Reporting Services – T-SQL Tuesday #005
    SQL Server: Using SQL Server Reporting Services to Manage Data
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Problem in Report Formula Column

    I recently Transfer my databse 9i to 10g and iam using developer 2.1 release 5 as a front hand.
    so problem is that my reports run successfully with oracle 9i but when i change my database to oracle 10g iam facing error in reports formula column. when i use select statement in formula column. i gave u an example about that.
    function CF_1Formula return Number is
         lc_count NUMBER;
    begin
         SELECT      count(*)
         INTO     lc_count
         FROM     tab;
         RETURN (NVL(lc_count,0));
    end;
    when i compile formula column i got this error.
    ORA-00600 internal error , argument:[17069], [19156148],[],[],[],[],[],[]
    please help me in this matter.
    Thanks.
    M.Sohail Tai

    hi fs,
    Thanks for reply me my friend.
    i also use the column name but same error is appeared when i compile formula column . this is only the example i gave to u. now i give u actual code.
    function CF_Close_Rate1Formula return Number is
    lc_rate number;
    begin
    select CL_RATES_CLOSE
    into lc_rate
    from sys_cl_rates
    where cp_id = :v_cp_id
    and loc_id = :v_loc_id
    and trade_type_id = :trade_type_id
    and cp_list_id = :cp_list_id
    and CL_RATES_DATE = (select max(cl_rates_date)
                   from sys_cl_rates
                   where cp_id = :V_CP_ID
                   and loc_id = :V_LOC_ID
                   and trade_type_id = :trade_type_id
                   and cp_list_id = :cp_list_id);
                   --= :lc_closing_date;
    return (nvl(lc_rate,0));
    EXCEPTION WHEN NO_DATA_FOUND THEN
    RETURN(0);
    end;
    This work properly with 9i database but not with 10g database.
    Reply me soon .
    Thanks,
    M.Sohail Tai

  • Can we use formula column in lexical parameter in sql query ...

    hi
    can we use formula column in lexical parameter in sql query ...
    as example
    i want to give
    select * from & c_table
    forumula
    function c_table
    if :p_sort = 1 then
    return 'dept'
    else
    return 'emp'
    end;
    c_table formula column
    is this possible ...
    i have such example in oracle apps reports
    if i try in ordinary report usinf emp table it show error ..
    how we can give formula column...
    please help me in this regard...
    Edited by: 797525 on Feb 20, 2012 9:31 PM

    thanks sir,
    iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from     mtl_demand md,     mtl_system_items msi,     mtl_txn_source_types     mtst,     mtl_item_locations loc     &C_source_from &C_from_cat
    &c_source_from and &c_from_cat formula column and there are defined at report level only ......
    pl/sql code &c_source_from is
    function C_source_fromFormula return VARCHAR2 is
    begin
    if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
    else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
    else if :P_source_type_id = 5 then
         if :C_source_where is null then
              return NULL;
         else
              return(',WIP_ENTITIES wip');
         end if;
    else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
    else if :P_source_type_id is null then
    return(',MTL_SALES_ORDERS      mkts,
    MTL_GENERIC_DISPOSITIONS mdsp,
    GL_CODE_COMBINATIONS gl ');
    else null;
    end if; end if; end if; end if; end if; end if;
    RETURN NULL; end;
    this is forumula column i hope that you understand what iam saying
    please help me in this regard....
    thanking you...

  • Can text be displayed in a formula column using mathematical functions?

    I am working with Financial Reports version 11.1.1.3 and I'm trying to accomplish the following scenario:
    Column D is a data column
    Column E is a text column containing the value "TEXT"
    Column F is a formula column with the following formula: IfThen([D]=0,[E],[D])
    What I want to see happen is if the value in column D is 0 then I want the value "TEXT" to appear in column F, otherwise; I want to show the data value that is in column D. Is it possible to display text in a formula column and if so, what is the syntax for that? Or does anyone have another way to accomplish this? Any help would be appreciated.
    Thanks!

    Short answer: No.
    For your particular issue, I would suggest putting your TEXT value in the #zero and #missing overrides in Report Studio.
    In general, Hyeprion Reporting does not do any real text validations or functions like you could use in Excel.

  • Display column values as a series/legend on a line chart where one column value can be more than one category

    Hi Everyone
    I don't know if this is possible or not, so I will describe it. I have a column in a table called Filing. There are currently three values in it ("Abuse", "Neglect", "Voluntary") and each record has this populated. I also have
    the below slicer for the column also.
    I would like to add a fourth value called "Abuse/Neglect" that would identify instances where both an Abuse and Neglect petition was filed, which is a subset of the Abuse and Neglect records in the Filing column.
    My question is, is it possible to create a line chart that has the 4 Filing possibilities: "Abuse", "Neglect", "Voluntary", "Abuse/Neglect" as the Series/Legend in the line chart?
    The problem is that there are records that are more than one category: Abuse or Neglect records can also be Abuse/Neglect.
    Paul

    Hi Paul,
    According to your description, there is a column with the values ("Abuse", "Neglect", "Voluntary") in your table, now what you need to is that add another value "Abuse/Neglect" in this column, and then use it
    as Series/Legend in the line chart, right?
    In this case, you can add calculated column to your table based on your logic. A calculated column is a column that you add to an existing PowerPivot table. Instead of pasting or importing values in the column, you create a DAX formula that defines
    the column values. The calculated column can be used in a PivotTable, PivotChart, or Power View report as you would any other data column. Please refer to the link below to see the details.
    https://msdn.microsoft.com/en-us/library/gg413492%28v=sql.110%29.aspx?f=255&MSPPError=-2147217396
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to use a Formula Column in the main query?

    Hi All,
    I've tried to use a formula columns defined in some query in the condition of that query like this:
    where (:cf_ex - :cf_ex2) >= 5
    but when I run the report no data returned! Why? and how to use it the condition of the query?
    Note: I'm using Forms 6i

    where (:cf_ex - :cf_ex2) >= 5You cannot do that. Formula columns are not part of the select statement (which runs in the database), but are processed in the report.
    When you created this query, my guess is that you got the message "Note: the query Q1 has created the bind parameter(s) cf_ex, cf_ex2". Check these User Parameters in your data model. So, you are actually referencing user parameters in the query, not formula columns.
    I made a computations and things using PL/SQL that can't be done in the select statement in the data model!If it's pl/sql you can probably use that in your query. Create some database functions for cf_ex and cf_ex2 and use these in your query.

  • Linking using formula column

    I've tried several ways of doing this, and this seems to be the easiest way. Basically, depending on the type of record, I need to use one of two columns to link to another query. So, if a row in query A has type 1, I need to use column X to link to query B. If a row in query A has type 2, I need to use column Y to link to query B.
    I thought the easiest way to do this would be to create a formula column in Query A that was the value of column X or Y as appropriate and then link to Query B using this formula field. However, I can't seem to link queries using a formula.
    Does anyone have any ideas how I can accomplish this? I'm new with Oracle reports, so go easy on me :)
    Thanks,
    Julie.

    What error are you getting?
    Is it: REP-1297: Data link child column 'CF_1' must be a database column?
    If so, the reason is the child column cannot be a formula column. The parent column, on the other hand, can be a formula column.
    If I understand your data model correctly, "A" is your parent query/group and "CF_1" is the formula column in query/group "A".
    "B" is your child query. "FK_1" (the foreign key column in query "B") is your child column.
    You should be able to link "CF_1" in "A" to "FK_1" in "B" by doing:
    - click on the link tool
    - click on "CF_1" in "A"
    - drag to "FK_1" in "B"
    - A link should be created. Double click on it to bring up the property palette for that link and you'd see the link properties.
    Hope that helps...

  • How to tell if column value has changed for use in workflow actions

    Hello,
    I am using Sharepoint 2010 and for one of my Lists, I am using a general list workflow.  What I need to be able to do is determine if a column value has change (say an "Assigned To" field) because I only want to take some action if that particular
    value has changed.  I want to be able to have a workflow action that would be something like:
    If Current Item: Assigned To not equals [OLD VALUE]
    I have found some web searches that talk about creating a duplicate list or duplicate (but hidden) column but that doesn't seem to be the way to go.  I have document versioning set but don't if that can be used to help with this.  One possible
    thought (although I haven't tried it to see if it works) is to create local variables and have the values in the variables be the "old value".  Just not sure if there is a best practices for doing this.
    Thanks for any thoughts - Peter

    Helen,
    Not sure I fully understand your goal.  We don't use "tasks" at all but if you are looking to have your workflow check certain valus and be able to send email messages to people based on whatever, then you can certainly do that (as long as your Sharepoint
    has the email setup.  We do this for alot of workflow tasks.
    So, in the workflow you can have a blanket statement like what I previously listed:
    if Current Item:hiddenStatus  not equals Current Item:Status
        .... do something
    or you can do something like:
    if Current Item:hiddenStatus equals "In-Progress"
        .... do something
    Else if Current Item:hiddenStatus  equals "Completed"
        .... do something
    or combine the two and do nested "if" statements.  Then you add an email statement wherever you need it like:
    if Current Item:hiddenStatus  equals "Completed"
       then email "these users"
    To add the email part, just type in "email" on the line where you want to add a statment.  There is only one option to choose from.  That will display the line "then email these users".   The "these users" will be a link.  When you
    click it you will get a popup to add the email info.  We typically will send the email to a user (or users) that are already listed in one of the PeoplePicker fields.  On the email form, you can type in your own text, designate that a value is based
    on a column value (like our PeoplePicker), designate that a value is based on a workflow variable, add a link to the current item, etc.  To get to these options you will click the button to the right of the fields or use the "Add or Change Lookup" button
    in the bottom-left for the text area.  There is alot you can set in the mail.
    Does this help answer your question?
    - Peter

Maybe you are looking for

  • Apex_application.g_notification

    Hi there, I use a plsql procedure within a process so that the users can fill the category field for all selected customers (within an array) with a value from a list. Sometimes this category value has already been set and it is not updated within th

  • Availability button to check inventory

    Hi, Edited by: user1174285 on Jun 15, 2011 3:22 PM

  • Using DW MX 2004 on old computer

    Here is the situation: I work on a G4 and have used this version of DreamWeaver 7 MX without issue for 3 years. My G5 is malfunctioning so I fire up my old G4. Unfortunately, when I attempt to use this full educational version, I get a message statin

  • ISE Posture to guest clients

    Hi Guys, i'd like to know if is it possible to make a posture to Guest Clients using the Web Agent  after they had been login into the portal. thanks

  • Question about CLASSPATH Prefix and others...

    Hi all, Would someone pls give me some help about the following questions: 1. how to set the CLASSPATH Prefix, CLASSPATH and SERVERCLASSPATH, and the usage of them? 2. the default JAVA_HOME is \WebLogic\jre1_2, after I changed it to \jdk1.1.7, the EJ