How to get the dynamic query result

If in one query, there is the amount range dimension, based on different dimension value combination, the customer revenue should be refreshed into different range, how to make it by cube?
eg.
Customer Store    Material  Month    Amount
C001     M & S    Tennis    2005/01   "10"
C001     Douglas  Tennis    2005/02   "60"
C002     M & S    Soccer    2005/01    "1"
C002     M & S    Soccer    2005/02    "50"
C002     M & S    Tennis    2005/02    "50"
C003     Douglas  Tennis    2005/01    20
Query condition:
Time Customer Amount Range     Amount
2005 C001     0~50_____________0
2005 C001     51~100___________70
2005 C001     100 +____________0
2005 C002     0~50_____________0
2005 C002     51~100___________0
2005 C002     100+_____________101
2005 C003     0~50_____________20
2005 C003     51~100___________0
2005 C003     100+_____________0
However, if I drill down Time into month, the result is total different, I only list the result related to customer C001
Time     Customer  Amount Range    Amount
2005/01  C001      0~50____________10
2005/01  C001      51~100__________0
2005/01  C001      100 +___________0
2005/02  C001      0~50____________0
2005/02  C001      51~100__________60
2005/02  C001      100 +___________0
Any good solution on that? Thanks for any input.
Message was edited by: Lei Shao

Hi, Sen,
I used your solution in my infocube and query, where I created a structure with 'between'. However, it is still the simple summation in different amount range.
Just like the following:
Sales ORG / Sales Office / Sales Rep / Amount
East      / Atlanta      / 1001      / 3
East      / Atlanta      / 1002      / 4
So the query result is the same:
S-ORG / S-Office / S-Rep / Amount Range / Amount
East  / Atlanta  / 1001  / 0~5          / 3
East  / Atlanta  / 1001  / 5+           / 0
East  / Atlanta  / 1002  / 0~5          / 4
East  / Atlanta  / 1002  / 5+           / 0
When I remove 'drill down' for Sales Rep, the result is:
S-ORG / S-Office / Amount Range / Amount
East  / Atlanta  / 0~5          / 7
East  / Atlanta  / 5+           / 0
However our expection for the result is different, because in business traction, if we remove sales rep, the sales org and sales office will get the sub-total like this: (we can image it with ABAP program sub-total)
Sales ORG / Sales Office / Amount
East      / Atlanta      / 7
So our expection for the result is:
S-ORG / S-Office / Amount Range / Amount
East  / Atlanta  / 0~5          / 0
East  / Atlanta  / 5+           / 7
Therefore, any good suggestion for this?
Thanks a lot
Regards,
LS

Similar Messages

  • How to get the sql query result?

    Hi,
    Currently I am using LV2012 to connect a Oracle database server. After the installations/settings for Oracle Express and Oracle ODBC driver done.
    I am sucessfully to use the SQL command to query the data through my window command prompt. 
    Now the problem is, how I do the same task in Labview by using the database connectivity toolkits?
    I have build a VI for query as attached, but i have no idea what pallete to use to get the query result.
    Please help me ~~
    Solved!
    Go to Solution.
    Attachments:
    Query.vi ‏9 KB

    Here is a piece of code I use to test SQL commands, you can use the part that retrieves sql results.
    It is also possible to get the column headers back, but that is for next lesson!
    Attachments:
    RunSQLCommand.vi ‏30 KB

  • How to get the dynamic columns in UWL portal

    Hi All,
    I am working on UWL Portal. I am new to UWL. I have down loaded uwl.standard XML file and costomized for getting the  values for "select a Subview" dropdown and I am able to see the values in the dropdown. Now my requirement is to get the dynamic columns based on the selection from dropdown value.
    can any body suggest on how to get the dynamic columns in UWL portal.

    Hi  Manorama,
    1) If you have already created a portal system as mentioned in following blog
                  /people/marcel.salein/blog/2007/03/14/how-to-create-a-portal-system-for-using-it-in-visual-composer
    2) If not, then try to create the same. Do not forgot to give the Alias name .
    3) After creating a system, log on to the VC, Create one iView.
    4) Now Click on "Find Data" button from the list which you can view in right side to Visual composer screen.
    5) After clicking on "Find Data" button, it will ask for System. If you have created your system correctly and Alias name is given properly, then your mentioned Alias name is appeared in that list.
    6) Select your system Alias name and perform search.
    7) It will display all the BAPIs and RFCs in your systems.
    8) Select required BAPI and develop the VC application.
    Please let me know if you any further problems.
    Thanks,
    Prashant
    Do reward points for useful answers.

  • How to get the Dynamic UI component value from JSFF page to any managedbean

    HI ,
    We have list of bean objects in jSF page we are iterating the list of bean using the forEach loop and displaying the value into Input type text (UI component) value filed .
    If we try to get the UI component value in Managed bean we are not getting the dynamic values .
    The below piece of code used to retrieve the dynamic values from the JSF page doesn't have any form :
    UIComponent component = null;
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (facesContext != null) {
    UIComponent root = facesContext.getViewRoot();
    component = findComponent(root, componentId);
    then component type casting to the based on UI component which we trying to access and getting the value as " NULL " ..Please let me know how to get the dynamic values form the JSF ?
    Please let me know if any other approach or any changes required on above ?
    Thanks

    Hi,
    the root problem is this
    <h:inputText id="it3" value="#{familyList.ctn}" />
    <tr:commandButton text="Save" id="cb3"Note how each row writes to the same managed bean property, thus showing the same data. Instead your managed bean should expose a HashMap property that you then apply values to using a key/value pair. The key could be the ID of the field, which then you also should dynamically define e.g. cb<rowIndx>. The command button could then have a f:attribute assigned that has the row HahMap key as a value. This way you truly create value instances for the object
    Frank

  • How to get the dynamic Crosstab header name ?

    Hi ,
    The crosstab resaults shows as below ,How to get the dynamic Crosstab header name ?
    | Countryname |
    | Province1 | Province2 |
    | here to get CountryName | here to get CountryName |
    how to get the Countryname in data ceil?
    thanks

    Could you please elaborate on your requirement?
    You want header to be dynamic?

  • How to insert the select query result into table?

    How to insert the select query result into table?
    SELECT  top 20 creation_time  
            ,last_execution_time 
            ,total_physical_reads
            ,total_logical_reads  
            ,total_logical_writes
            , execution_count 
            , total_worker_time
            , total_elapsed_time 
            , total_elapsed_time / execution_count avg_elapsed_time
            ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
             ((CASE statement_end_offset 
              WHEN -1 THEN DATALENGTH(st.text)
              ELSE qs.statement_end_offset END 
                - qs.statement_start_offset)/2) + 1) AS statement_text
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
    ORDER BY total_elapsed_time / execution_count DESC;
    Thanks,
    Tirumala

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • How to get the SQL Query statement of a Search Form ?

    Hi all,
    We have a requirement to send the query result of an ADF Search Form into report application (Crystal rpt).
    Crystal can accept data source as query statement. SO I think of getting the exact query statement "generated" by the ADF Search form and send it to crystal.
    Is this possible ?
    Thank you very much,
    xtanto

    Try the various get methods of the viewObject such as getQuery:
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtAnchor.getQuery%28%29/vtTopicFile.bc4jjavadoc%7Crt%7Coracle%7Cjbo%7CViewObject%7Ehtml/

  • How to get the Actual Query of View Object

    Hi all,
    I have a standard. I need to modify the query of the VO attached to a picklist based on responsibility. I am able to achieve my requirement but it is getting reflected for all the responsibilities even though i extended the controller for a particular responsibility. I used setQuery() to change the query of my VO. When checking "About this page". The code i added also shown in the page. Now i want to get the actual query to the VO before the controller is extended so that i can set the modified query or actual query based on my responsibility. Kindly share your knowledge.
    Regards,
    Pradeep

    Hi,
    I guess following query will not work ,Why use 2 where clauses.
    SELECT * FROM (select NVL(VENUE_NAME,' ') "Venue",
    NVL(VENUE_CITY,' ') "City",
    NVL(COUNTRY_DESC,' ') "Country",
    EVENT_NUMBER
    From NS_EVENT_VENUE_DETAILS,NS_COUNTRY_MASTER WHERE COUNTRY_CODE = VENUE_COUNTRY) QRSLT WHERE (QRSLT.EVENT_NUMBER = 1539
    you can as following using bind variable.
    http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcquerying.htm#CEGDGIJH

  • How to get the individual query terms?

    Is there a way in Intermedia to get the individual query terms that are expanded by intermedia after a query using stemming or fuzzy matching.
    Example: a query like "$distinguish" expands to distinguish, distinguished and distinguishes.
    CTX_DOC.MARKUP does the work but returns the complete contents (with markup) of the indexed column in stead of the query terms only.

      1  with t as
      2  ( select 1 day_from, 3 day_to from dual)
      3  select day_from +level -1 day_from, day_to
      4  from t
      5* connect by level <= day_to
    SQL>
    SQL>/
      DAY_FROM     DAY_TO
             1          3
             2          3
             3          3

  • How to get the original query string in an event receiver when dialogs are enabled

    I have scenario where I am adding a document to a document library which has an external data column on it. My goal for this column is to have it automatically populated with an appropriate value based on original query string to the page. The general
    idea is that I am on a custom page that has various webparts on it including a view of my document library that is context sensative based on the query string, and I want to use that context sensitivity not just to filter the list but also when adding documents.
    I have been searching around for solutions to this problem all day and have gotten this far:
    I have an event receiver attached to my document library that handles the ItemAdded event syncronously (as such I have the new list item available to me). In that event receiver I am able to set the column values as required. Where I am stuck is on getting
    the value from the query string that I need to actually set as the column value.
    Based on:
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/8cfcb299-9a55-4139-86ec-0b53b2922a54 and several similar articles/posts I have been able to get the original source Url with the query string I want via the following
    code in my event receiver:
    private HttpContext context;
    public EventReceiver1()
    context = HttpContext.Current;
    public override void ItemAdded(SPItemEventProperties properties)
    var originalQueryString = context.Request.QueryString["Source"];
    // Parse the query string and use the value ...
    The problem is that this solution breaks down if the dialogs are turned on under the advanced settings for the list. The reason the solution fails is because the "Source" query string parameter goes away and is replaced by "IsDlg" set to a value of "1".
    Does anyone know how to get past this hurdle? Any help would be greatly appreciated.

    Hi Stuart,
    The reason I'm looking for "Source" in the query string is because that is something I found to be reliable when the Dialogs are turned off. I've dug around pretty deep in the Request object to see if anything had the data I was looking for and unfortunately
    it doesn't appear to be there. The
    context.Request.QUeryString.ToString()
    returns a rather simple one of:
    List=%7b43ECDCB0-8440-4652-B067-AA20481779D7%7d&RootFolder=&IsDlg=1
    and the
    context.Request.UrlReferrer.Query.ToString()
    has the same value.
    I suspect this is due to the dual step process that takes place in adding an item to a document library where the first modal popup (which I suspect likely has the information I need) gives you the opportunity to browse to your file and then the second
    dialog (maybe this is getting brought up as a result of another request which is now referring back to the original request that brought up the first dialog?) where you edit your properties.
    Thanks for the try though, if you've got anything else I'd love to hear it.

  • How to get the dynamic Crosstab header Title

    Hi,
    my sql show as below
    select country,province, month, income from salestable
    As above content ,I build a crosstab ,use the month as left column,use "country" as level 1 header column ,use province as level2 header column,use income as summary value
    now ,in the income ceil, I want to get the current dynamic country title value
    How can i do to get it ?
    thanks a lot !!

    Use the
    <?./H?> in the new form-field inside the for-each <?for-each@cell:.//R1C1?>.
    You should be able to see the corresponding header value displayed

  • How to open the TFS query results in Excel?

    Hello Guys,
    Question 1: Is there any way to export the query results from the TFS web browser?
    Question 2: Is there any way to export the query results from Team Explorer 2013?
    Here is the query results in TFS:
    How do I export this result in excel for further analysis? 
    I have also connected to Team explorer 2013 and right clicked on the query, but there is no option to open the results in Excel, see below:

    Hello,
    _Pls follow these guide lines for ensuring proper output in Microsoft Excel:
    1.First compare the fields properties and the frames properties between the reports created with wizard and the reports created manually.
    2. Do not leave any space between two adjacent objects.
    Explanation: Because any space, including a few pixels, between two adjacent objects will result in an empty cell or column in Excel output
    3.Make sure that the widths of all objects are vertically consistent.
    Explanation: If the objects are not exactly aligned vertically, that is, have inconsistent widths, it is likely to result in insertion of unwanted cells/columns in Excel.
    4. Pls. Make sure that the vertical elasticity of the frames and repeating frames is not fixed unless you are sure you have allocated enough space to accommodate all the records.
    Explanation: If you set the Vertical Elasticity property of a frame to Fixed, the output in Excel will show only as many records as could appear on the first page of the paper output. Since Excel does not have a page concept, it is not able to overflow the remaining rows to the next page.
    5. For reliable formatting of spreadsheet output, enclose the whole layout area in a frame.
    Explanation: This action prevents the possibility of parallel objects displaying in different vertical positions, one following the other.
    Hope this helps.
    Regards,
    Alex

  • How to upload the web query result  to CSV/Text file

    Hi,
    Kindly help me on the following.
    1)       I have info-provider (IP), which has info-objects "company code" and "supplier".
    2)       I built a query by putting company-code with a variable in free-charateristics and supplier-code in row.
    3)       When I run this query, it will ask company-code as input and the result will be filtered using company-code.
    4)       For this query, I created a web-template and assigned data-provider to display the data on the web.
    5)       The user wants to enter input company-code='1000' and write the data in a CSV file in a specific directory. i.e, by clicking the execute button (after entering company code) , the result should go to the CSV or text file. i.e. the application should automatically generate the file with query results.
    Note: The user should not use context menu to EXPORT TO CSV OR EXCEL file.
    Please let me know, if there is any tutorial. Thanks a lot advance help.
    Regards
    Kandasamy

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • How to get an sql query result to a textbox?

    i am working with jdk1.4 and office 2003.
    i need to run the following SQL Query: "SELECT max(BookId) as BookId FROM Books" where BookId is an autonumeric generated number obtained from the field autonumber in access 2003 database.
    now, the result of this must be placed in a textbox.
    does anyone knows how to do this?
    I ve tried this but nothing happens and niether any error comes
    st = con.createStatement ();     //Creating Statement Object.
    long bookNo;          //Use for Comparing the Book's Id.
    try {     //SELECT Query to Retrieved the Record.
    String q = "SELECT max(BookId) as BookId FROM Books";
    ResultSet rs = st.executeQuery (q);     //Executing the Query.
    bookNo = rs.getLong ("BookId");          //Storing the Record.
    bookNo =(bookNo+1);
    txtBookId.setText (""+bookNo);
    catch (SQLException sqlex) { }
    does anyone knows how to do this?????plz help me out.
    Thanks
    Aanchal

    Hi Aanchal,
    If an SQL error occurs now, you cannot see it in your code. You should do something with the exception you catch, e.g. printing it: sqlex.printStackTrace(), so that you can see if something goes wrong.
    For your number, you should move the cursor in the resultset to the first row - either by: calling first( ) or next ( ), then you can retrieve your booknumber.
    Best Regards,
    Martijn

  • Table name stored in another table and how to Build the Dynamic Query

    TblMasterTable
    Id
    Unqid
    Tbl_TemplateNameid
    Tbl_Template1
    Unqid
    Field1
    Filed2
    Tbl_Template2
    Unqid
    Field1
    Filed2
    Filed3
    Tbl_Template3
    Unqid
    Field1
    Filed2
    Filed3
    Filed4
    Filed5
    TblMasterTable contains the reference for the table names.
    TblMasterTable contains the data
    1 12     Tbl_Template1
    2 22     Tbl_Template2
    3 12     Tbl_Template1
    4 343 Tbl_Template3
    I want to build the query to retrieve all the Template table records based on the TblmasterTable data for a given id.

    This is possible but you need to understand the performance implications of Dynamic SQL before proceeding with this approach.
    <br>
    use this logic:<br>
    declare sqlstring varchar2(500):=null <br>
    select 'select stuff from '|| tbl_templatenameid into sqlstring from MasterTable where id=someid;<br>
    execute immediate sqlstring;
    <br>
    <br>
    I have really seen very few cases where this approach is justified.
    <br>
    <br>
    Dave<br>
    lehr.servehttp.com

Maybe you are looking for

  • My service has been turned off even though I returned phone?

    I am so unhappy with Verizon! I have been a Verizon customer (loyal) for over 13 years now. I always loved them, bragged about them, encouraged friends, family and clients to sign up with them as well. Until last year. I sucked it up every time I upg

  • User can't access afp shares

    About once every other day one of my users losses the ability to log onto afp shares on the server. In the Server App under Users his "Allow user to log in" tick box has become unticked.  If I tick that and save, everything is fine for a day or so th

  • Uwl iview tab navigation prblem

    Hi Experts, i am using portal 7.0 UWL webflow connector is configured succesfully, and it is showing tasks in alert tab,but when i am going notification tab or tracking tab and want to come back agin in alert tab it is not displaying any task,but whe

  • Blanket PO ( Framework Order)

    Hi Folks, I am trying to configure Blanket PO and am having some issue. Could someone help me please. in OMR6 i have set the tolerance limits  for tolerance keys LA & LD both Absolute and Percentage.. and also set up error status for message 297. Whe

  • SEM BPS material

    I am new SEM BPS, please send me the documents for that. Quick response will be appreciated with points. My Email Id is [email protected] And please can somebody share whts the work related to SAP BW as i am BW consultant. Thanks and Regards habeeb