Create variable from query filter

Hello;
I want to define  @prompt parameters as dimension or measure. So that we will use those parameters for the calculations we will use in our reports.
For example; we will like to use prompt for year in efasion universe. This prompt is going to ask two year parameter (the operant we will use is between) We want to get the difference between these two years . and we will like to save that value as a  different variable.
System: BusinessObjects XI 3.1
Thanks in advance.
Akar;
Edited by: Akar Selcik on Apr 22, 2011 12:07 PM

hi Dineshkumar89 ;
I checked the your formula . But variable when used alone returns correct results But it returns wrong value or error  in same record.
for instance;
i created a variable named diff.year.  formula = Abs(ToNumber(First([Year]))-ToNumber(Last([Year])))
selection value :  First : 2001  Last:  2003 
year     Sales Revenue Diff.year
2001     39600         0
2001     3500         0
2003     6500         0
Results should be as below.
year     Sales Revenue  Diff.year
2001     39600          2
2001     3500          2
2003     6500           2
thanks.
Akar;

Similar Messages

  • Can't subtotal on measure variables from Query 2 in merge dimension report

    I use a query identifying customers (Query1.HH_ID) sold by each salesperson. A second query identifies a subset of those customers who are longtime customers. I merge these queries using the dimension, HH_ID. I project Query1.HH_ID onto the report and create a variable via =If([Query2].[HH_count]=1;1;0) to get a measure which is either 1 or 0 depending on whether a record is retrieved from Query2 with a value for Query2.HH_ID that matches Query1.HH_ID. The report is fine at the detail level, but when I insert a break and try to subtotal the measures, the variable from Query 2 produces a subtotal of 0 even though I can see a mixture of detail records with 1s and 0s. It appears that one cannot subtotal on measures from Query2 in a merged dimension report, or at least not if the merged dimension is not projected onto the report but rather only the dimension from Query1. Is this a known principle?

    Hi Michael,
    I think the issue is that they Query2.HH_Count is being summed first. So if you have a mixture of values, say
    rownumber, value
    1,1
    2,0
    3,1,
    4,0
    you will get 0 as your HH_count will equal 2.
    Try
    =If(Query2.HH_count>=1;1;0)
    Alternatively try
    =If(Average(Query2.HH_count)=1;1;0)
    Hope this helps
    Alan

  • Use Yesterday as variable for Query Filter

    Post Author: rrburton
    CA Forum: WebIntelligence Reporting
    I want to have a query filter that refers to the previous day.  In regular SQL I would use something like "= trunc(sysdate)-1".  I don't see any option for doing it this way in web intelligence, the closest it comes is selecting object and then assigning the Beginning of Last Week item from the System Date table.  What am I missing?

    Post Author: rrburton
    CA Forum: WebIntelligence Reporting
    Nevermind - I figured it out just now.  It isn't very intuitive.  In the Objects and Variables dialog in the SystemDate table there are a bunch of items like 1 day, 2 days, etc. and you select one of those and then in the code it looks like:
    WHERE   PKG_NTD_CONV.TO_ORCL_DATE(TROUBLE_TICKET_ARCHIVE.CREATE_DATE)  =  ( sysdate )-1
    It should say something like 1 day ago, 2 days ago, etc.

  • Delete variable from Query

    Hi Guru's,
       I copied a query saved with a new name and made some changes to the new one, when I run the Query I get 3 variables(pop up) eg., PlanVersion, Period Interval, Year. I dont need Plan Version, Period Interval, but need just the Year...When I see the Query Properties I see all the three Variables I dont have the option to delete any of them... Any ideas would be highly appreciated...
    Cheers..
    PR

    Hi PR,
    You cannot delete the variables from the query properties. You will need to delete them from the query definition (rows, columns, filter and free char areas). The period variable would be restricting char 0FISCPER (most probably) so see where it is included in the query definition and remove it from there. Same goes for the Plan Version.
    Hope this helps...

  • Creating Variables From Text File

    Hello a little new to powershell and have banging my head on the wall trying to get this working.
    I have a text file (where the numbers of lines will change everytime) that will contain AD groups. 
    Lets say it looks like this
    GroupA
    GroupB
    GroupC
    I'm trying to you a loop that will read the file and output each new line to a variable so
    var1=GroupA
    Var2 =GroupB
    Var3=Groupc
    My first problem is that non of these can be null since this will be then be used with Add-ADgroupmemeber
    So I have it get the number of items with $Items = get-content *File* | Measure-Object -Line
    After that I have been trying to use a loop which to me looks like it should work however is not. I'm not getting any errors. However I'm not getting any created variables either. 
    For ($i=1; $i -lt $Items.lines; $i++) {
    $var[$i] = (Get-Content *File*)[$i-1]
    write-host $var[$i]}
    In my head I should get a listed of each line of the txt file but I'm getting nothing. 
    In the end I was hoping to doing something along the lines of ADD-Adgroupmember -identity $Var[$i] -members *Machine Name*
    If there is a better way to approach this I'm all ears.
    Thanks for any help!

    You don't need a loop to read each line from the file. You don't need a variable for each group read from the file. 
    For example, if your file looks like:
    GroupA
    GroupB
    GroupC
    with spaces/empty lines in it, that you wish to ignore, you can use:
    $Groups = Get-Content .\groups2.txt | % { ($_.split(" ",[System.StringSplitOptions]::RemoveEmptyEntries)) }
    The $Groups variable will be an array that holds non-empty lines from the file. You can use that directly as in:
    foreach ($Group in (Get-Content .\groups2.txt | % { ($_.split(" ",[System.StringSplitOptions]::RemoveEmptyEntries)) })) {
    Add-ADGroupMember -identity $Group -members *Machine Name*
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • Access session scope variables from a filter

    I have a filter I am using to check if 2 people are loged in with the same user name.
    When my web app loads I store the user name in a class that has session scope.
    Is there a way for me to access this class from the Filter class?
    How do I access the session instance from this class?
    How do I pass parameters to the Filter class?
    Thank you,
    Al

    http://forum.java.sun.com/thread.jspa?threadID=5122925&tstart=0

  • Create collection from query with bind variable

    Apex 4.0.2
    Per Joel Re: Collection with bind variable the apex_collection.create_collection_from_query_b supports queries containing bind variable references (:P1_X) but I am not sure how to use this feature, the documentation doesn't have an example, just the API signature for the overloaded version has changed.
    If the query contains 2 bind variable references to session state (:P1_X and :P1_Y), can someone please show an example of what to pass in for the p_names and p_values parameters to the API?
    Thanks
    procedure create_collection_from_query_b(
        -- Create a named collection from the supplied query using bulk operations.  The query will
        -- be parsed as the application owner.  If a collection exists with the same name for the current
        -- user in the same session for the current Flow ID, an application error will be raised.
        -- This procedure uses bulk dynamic SQL to perform the fetch and insert operations into the named
        -- collection.  Two limitations are imposed by this procedure:
        --   1) The MD5 checksum for the member data will not be computed
        --   2) No column value in query p_query can exceed 2,000 bytes
        -- Arguments:
        --     p_collection_name   =  Name of collection.  Maximum length can be
        --                            255 bytes.  Note that collection_names are case-insensitive,
        --                            as the collection name will be converted to upper case
        --     p_query             =  Query to be executed which will populate the members of the
        --                            collection.  If p_query is numeric, it is assumed to be
        --                            a DBMS_SQL cursor.
        -- example(s):
        --     l_query := 'select make, model, caliber from firearms';
        --     apex_collection.create_collection_from_query_b( p_collection_name => 'Firearm', p_query => l_query );
        p_collection_name in varchar2,
        p_query           in varchar2,
        p_names           in wwv_flow_global.vc_arr2,
        p_values          in wwv_flow_global.vc_arr2,
        p_max_row_count   in number default null)
        ;

    VANJ wrote:
    Apex 4.0.2
    Per Joel Re: Collection with bind variable the apex_collection.create_collection_from_query_b supports queries containing bind variable references (:P1_X) but I am not sure how to use this feature, the documentation doesn't have an example, just the API signature for the overloaded version has changed.
    If the query contains 2 bind variable references to session state (:P1_X and :P1_Y), can someone please show an example of what to pass in for the p_names and p_values parameters to the API?Not tried it, but guessing something like
    apex_collection.create_collection_from_query_b(
        p_collection_name => 'foobar'
      , p_query => 'select f.foo_id, b.bar_id, b.baz from foo f, bar b where f.foo_id = b.foo_id and f.x = to_number(:p1_x) and b.y = :p1_y'
      , p_names => apex_util.string_to_table('p1_x:p1_y')
      , p_values => apex_util.string_to_table(v('p1_x') || ':' || v('p1_y')))

  • How to get value in variable from query in PLD / ALD

    Hi, everyone,
    I want to retrieve value from database via query in PLD/ALD variable on basic of PLD / ALD variable's content. is it possible ?

    Hi
    Try this,
    ->> Open the GRPO document.
    ->> Click the Tools on menu bar and Open the Form Setting widnow.
    ->> put the tick mark in BaseRef, BaseDoc, TrgetDoc
    i think, Base Document no field default in SAP B1.
    try to search the Base doc. Date in row level on GRPO document.
    Try to Create UDF & FMS then assign the FMS in UDF
    SELECT Distinct T1.DocDate
    FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry
    WHERE
    T1.[DocNum]=$[PDN1.BaseRef]
    OR
    SELECT Distinct T1.DocDate
    FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry and
                T0.BaseLine=T1.LineNum and T0.BaseType=22
    WHERE T0.[BaseType] =22
       and T1.[DocNum]=$[PDN1.BaseRef]
    IF you more details, Check the below thread.
    Re: How to store the invoice number in the head of the related delivery ?
    Regards,
    Madhan.
    Edited by: Madhan Babu C on Dec 11, 2009 6:57 AM

  • Help with project: trying to create variables from decimals

    topic may be a bit unclear, but I have a project from a java course. I need to create a simple program, but hit a bit of a bump.
    I have made a formula to find that the total hours equals 2.7350 which is equal to 2hours, 44minutes, 6seconds.
    so to sum what I just said up, I have the number 2.7350, but need to display 2hours, 44minutes, 6seconds
    now I need help of how I can accomplish this with basic java (this is my first java class).
    If there is a way to leave 2 and take .7350 in separate variables, I can make some more formulas to convert that to the answer I need displayed, but I don't know how.
    Please help if you have ideas
    Thank You

    ahh, that just gave me an idea, I can't believe subtraction didn't come into my mind.
    I also should have mentioned that the numbers are generated via formula and user input, so it is not pre set.
    I will try something out with the subtraction idea. however, if you have a solution please post it in case my idea doesn't work.
    thanks again ^^

  • Create table from query in Form

    I want to create table in Form 6i, on form I have :sdate , :edate and :dpt Item.
    PROCEDURE TableView IS
    BEGIN
    FORMS_DDL('drop table test');
    declare
    v_com varchar2(4000);
    BEGIN
    V_COM := 'Create table test as
           select * from emp
    where hiredate between :sdate and :edate
    and deptno = :dpt
    FORMS_DDL(V_COM);
    end;When I was tried in TOAD It is showing error
    ORA-01036: illegal variable name/number
    Edited by: Ahmed on Oct 19, 2011 11:11 PM

    you can't use bind variables within forms_ddl. An option would be to not do any ddl at all, and do something like this:
    delete from test;
    insert into test(a,b,c)
    select a,b,c from emp
    where hiredate between :sdate and :edate
    and deptno = :dpt;cheers

  • Creating XML from query result (how?)

    Hi,
    It's a very general question. That is the simplest way to create XML containing data returned by a query?
    I've got 3 tables: 2 primary and a linked table. One of the primary tables contains a CLOB column. I need to export the tables to a XML file. That is the simplest way to do that? (There is many XML-related functions in Oracle XML DB and I don't know which may be good.)
    Thanks in advance,
    JackK

    That is the simplest way to create XML containing data returned by a query?Simplest:
    SQL> set long 10000
    SQL> set pages 5000
    SQL> show user
    USER is "SYS"
    SQL>  select XMLTYPE(CURSOR(select * from user_objects where rownum = 1)) as SIMPLEST
      2  from dual;
    SIMPLEST
    <?xml version="1.0"?>
    <ROWSET>
      <ROW>
        <OBJECT_NAME>ICOL$</OBJECT_NAME>
        <OBJECT_ID>20</OBJECT_ID>
        <DATA_OBJECT_ID>2</DATA_OBJECT_ID>
        <OBJECT_TYPE>TABLE</OBJECT_TYPE>
        <CREATED>16-JAN-13</CREATED>
        <LAST_DDL_TIME>16-JAN-13</LAST_DDL_TIME>
        <TIMESTAMP>2013-01-16:10:03:32</TIMESTAMP>
        <STATUS>VALID</STATUS>
        <TEMPORARY>N</TEMPORARY>
        <GENERATED>N</GENERATED>
        <SECONDARY>N</SECONDARY>
        <NAMESPACE>1</NAMESPACE>
      </ROW>
    </ROWSET>Edited by: Marco Gralike on Mar 13, 2013 1:59 PM

  • Retrieving user created variables from multiple instances using PAPI-WS

    Hi,
    I'm using PAPI-WS to retrieve a list of instances from Oracle BPM 10.3.1.0.0 using ProcessGetInstance. These are modeled as external tasks. ProcessGetInstance returns an InstanceInfoBean which has no place for user defined variables that were set when the instances were started.
    The only way to get user defined variables seems to be to iterate through the entire list and send an InstanceGetVariable request for each one. InstanceGetVariable does not seem allow more than one instance id to be specified in a call from my testing. This is very inefficient since we could easily have hundreds of instances that we're trying to display. Is there some way to get the list of instances to include the user defined variables, or to get the user defined variables for more than one instance in a single call?
    Thanks,
    Steve

    I can't reproduce the problem. This is what I see:C:\temp>javac -cp . Ttest.java
    C:\temp>java -version
    java version "1.6.0"
    Java(TM) SE Runtime Environment (build 1.6.0-b105)
    Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
    C:\temp>java -cp . Ttest
    1
    3
    3

  • Creating count from queried fields

    Post Author: John
    CA Forum: Formula
    Hello all.  Newbie here to the forum and CR.
    Running CR 9
    I have a report that extracts certain data from the database.  A field that displays "test code", is not part of the original search criteria.  I have been asked to total "test code" but, I don't know how to count the records from the extracted data.
    For example,  I'm pulling in everyone with a last name that begins with a "J" and who came in the store from 01/01/07 - 01/31/07.  I then list the data and also print their address, city, state, zip, and "test code".  The "test code" is one of 3 possible codes.  I want to have 1 running total for each of these 3. 
    My knowledge allows me to create a running total on the field but, the total is from ALL of the records that match.
    So, if we had 45 people with "J" and 01/01/07 - 01/31/07, the running total will be 67 because it is finding all data sets that match it's code.  It isn't pulling from the original search criteria of "J" and 01/01/07 - 01/31/07.
    Any help is appreciated.
    John

    Post Author: yangster
    CA Forum: Formula
    A running total runs along side the data so it should never be placed in a header or the detail section.It must always reside in a group footer, page footer or report footer.Your basic running total in crystal will initilize at the report header, evaluate at the detail level and display the value in the report footer.So for your generalized case you have a simple running total that starts a count at 0 to start the report.You running total should be setup like thisField to summarize -> Product_IDType of summary -> countEvaluate - using formula -> inside formula typed in (if product_id = 4344211 then true else false)Reset -> neverAnd it won't matter if you put it in the GF2, GF1, PF, or RF the value will always be 4.  If your report spans multiple pages though you should not put the formula in the PF as it report the running total as of the page but keep on totaling to the next page.My suggestion to you would be to test your report with a manual running total to see exactly where your numbers counting is going astray.To do that create 3 formulas@init_count  (place in report header)whileprintingrecords;numbervar a;a:= 0@eval_count (place at the detail level)whileprintingrecords;numbervar a;if product = 4344211 thena := a + 1@display_count (place in the report footer)whileprintingrecords;numbervar a;athis will show you exactly what is being counted for every single item in your reportnormally you'd use a manual running total to get a summary of a summary or to sum a value at a group level but this should help you decode what is causing you buggy datahope this helps

  • Fox Formula Variable In Query Designer

    Hi Experts,
    I have created 1 variable in fox formula of type VARV and i want this Variable to show in query designer while creating new Variable so that i can replace the Query Variable With Fox Formula by Using Replacement Path.
    While Creating new variable in Query Designer it is not Showing that Fox Formula variable.
    Because i want to use this in WAD While Executing the Planning Sequence.
    Is there any way we could get That Fox Formula variable in Query Designer.
    Regards
    Girish

    Hi Marc,
    While Creating Variable from Query Using Query Properties it is still not Showing That Variable in Fox Formula.
    And My Requirement was to Replace that Fox Formula Variable With Query Designer Variable.
    Please Suggest any Solution.
    Thanks
    Girish

  • InputDate and Data parameter from query

    Hello,
    I'm expiriencing some problems with my Web project,
    I have Model and View.
    I created ViewObject from query with parameter:
    SELECT  r.room_id FROM rooms r WHERE (r.from_date>=:from_date);Parameter :from_date has type 'Date'.
    In ApplicationModule everythin works fine, but on jspx no (I've created ADF Parameter Form from ExecuteWithParameters operation)
    <af:inputDate value="#{bindings.from_date.inputValue}"
                                label="#{bindings.from_date.hints.label}"
                                required="#{bindings.from_date.hints.mandatory}"
                                shortDesc="#{bindings.from_date.hints.tooltip}"
                                binding="#{backing_request.inputDate1}"
                                id="inputDate1">
                    <f:validator binding="#{bindings.from_date.validator}"/>
                    <af:convertDateTime pattern="#{bindings.from_date.format}"/>
                  </af:inputDate>In JSPX parameter don't work, maybe it is still default?
    I tried using convertDateTime and modyfing DateFormat in View Object but without effect :(
    Could you please provide me some hint where I could look for my mistake?

    After few hours in fight I finally got working form. I don't know if I'm right, I suppose that it wasn't my bad but SQLDevelopers' ;)
    Originally I added new rows into table with SQLDeveloper, yesterday I created input form on JSPX page and add new row with Submit button, suddenly my 'ExecuteWithParameter' JSPX page has worked.
    Does SQLDeveloper could be the reason?

Maybe you are looking for

  • ITunes can't distinguish between movies and TV shows

    Hi, How old is iTunes now? How many updates have we been fed with all kinds of new 'features' that are either not that useful or already duplicate functions? Why can iTunes STILL not catalog files correctly? I have movies and TV shows all mixed toget

  • Flash Player not working on Flickr MySpace ..

    well, not sure if it's cos of this apple-adobe twist, nevertheless. since the last update to the latest version of flash player, i am no lonver able to watch videos on myspace or listen to music on the bands profiles. flash is workin fine on youtube.

  • How to select left or right channel while playing video in QuickTime X?

    I have recorded a TV movie with EyeTV and exported it to Apple TV format (M4v). In Germany often stereo movies have original soundtrack on right channel (e.g. English) and German soundtrack on left channel. With QuickTime 7 it was no problem to selec

  • Getting ewrror while creating GD view Extracter

    Hi, I was try to create genric extractor where i was getting error While creating view generic extractor where i am getting error "Entry A V_ZFRT does not exist in DD02L - check your entry". My requirement is need to create extractor which is getting

  • Damaged Install Disc

    The situation- I went to install Final Cut Studio 2 on my relatively new Macbook Pro. During the "preparing to install" phase I was informed that the installation failed because there was no software to install. Perplexed, I removed the disc to find