Query for applying constraints?

Requirement
To search for the products whose SKU's start date is less than today and end date is greater than today.
Pre-Condition
•     In our Project indexing is at product level
•     Start Date and End Date is at Child SKU level.
Problem
In XHTML, for a product start date and end date is indexed for each SKU, resulting in 'n' number of start dates and 'n' number of end dates for the product.
Now, if we give a constraint for start date and end date then, search compares any of the 'n' start date indexed for the product with the constraint and any of the 'n' end date indexed for the products. Because of this issue extra products are returned and filtering is not correct.
For Example
I have two products
DATA
Product 1 with two child SKUs and following are its start date and end Date:
All of these values are indexed in XHTML for Product 1.
Product 1
Child SKU1 - Start date: 20-Feb-2011
End date: 25-Jun-2011
Child SKU2 - Start date: 20-Jul-2011
End date: 20-Aug-2011
Product 2 with two child SKUs and following are its start date and end Date:
All of these values are indexed in XHTML for Product 2.
Product 2
Child SKU1 - Start date: 20-Feb-2011
End date: 25-Aug-2011
Child SKU2 - Start date: 20-Jul-2011
End date: 20-Aug-2011
CONSTRAINTS
Following constraints are passed to search:
start date < 29th Jun 2011
and
End date > 29th Jun 2011
RESULTS
Following results are coming from search,
Product 1,Product 2
Product 2 is fine but Product 1 should not have come as the result.
Search is comparing start date of first child sku of Product 1 and end date of second child SKU of Product 1 because of which wrong product is getting returned.
Query: Is there some way while indexing or applying constraint where I can specify that ATG Search should compare values for each child SKU and not all together.
Regards,
Isha

Did you try writing an indexedItemsGroup - rules to filter it before doing an index.
Thanks,
Renji

Similar Messages

  • How i can give date in each input for applying the exchange rate in Query.

    Hi Gurus,
    We have a requirement to create some currency conversion queries. In the selection screen user should be able to give four inputs. Like given below
    Input 1.          a)  key figures
                            b) Fiscal Year
                            c) Fiscal Period
                            d) Exchange Rate Type
                            e) Date (Exchange rate will be applied which is applicable on the given date)
      Input 2.         a)  key figures
                            b) Fiscal Year
                            c) Fiscal Period
                            d) Exchange Rate Type
                            e) Date (Exchange rate will be applied which is applicable on the given date)
    Input 3.          a)  key figures
                            b) Fiscal Year
                            c) Fiscal Period
                            d) Exchange Rate Type
                            e) Date (Exchange rate will be applied which is applicable on the given date)
    Input 4.          a)  key figures
                            b) Fiscal Year
                            c) Fiscal Period
                            d) Exchange Rate Type
                            e) Date (Exchange rate will be applied which is applicable on the given date)
    So we will have 4 key figures in the query results with the exchange rate applied on the given date.
    I will make four restricted key figures and make the query. I do not know how i can give date in each input for applying the exchange rate.
    Please give your suggestions to resolve my problem.
    Many thaks in advance.

    You can not bring the key figures in the selection screen for the currency translation. Instead you can apply a currency translation type to respective key figures in the query definition.
    The currency translation type can be defined in RSCUR transaction, where you can maintain the parameters like Exchange Rate Type, Exchange Rate Date etc.
    You can refer one of my article on this at
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/600157ec-44e5-2b10-abb0-dc9d06ba6c2f
    Hope this helps.
    Regards,
    Yogesh

  • Applying functions to database fields when querying for a form field

    Hi,
    how is it possible to apply trim() or another method to the content of a database field when a query is initiated?
    The actual problem is that there are entries in the database which are entailed by a blank and, because the user is not aware of this fact, he cannot be forced to add a blank or % to the form field he is querying.
    Does anyone have an idea how to solve this issue?
    Thank you very much in advance.
    Message was edited by:
    user492074
    null

    The where clause is built that way:
    WHERE (ETN.trim(ETN_PLZ)=:1)
    The error message:
    ORA-00904: "ETN"."TRIM": invalid identifier
    Actually, I guess that the trim statements should surround ETN.ETN_PLZ but that is obviously not the case.
    Apart from that I did not enter 1 as the value to query for.
    Nevertheless, thank you for your help. Forms version is 10.1.2 by the way.

  • Microsoft Query for Office 2013 Home and Business

    Where can I get Microsoft Query for Office 2013 Home and Business version?  I have used it for years on my old XP machine with Office 2003.
    Thank you, Sue

    Hi,
    You seem got an error like "Microsoft query could not be started because it isn’t installed" when you used it. 
    It may be not installed yet. We can go to "Control Panel\All Control Panel Items\Programs and Features\Office 2013 Home and Business\change\Microsoft tools\MS query" and check if it is installed/enabled.
    If it is not installed, please use the Install CD/ full installation copy to reinstall it.
    http://social.technet.microsoft.com/Forums/office/en-US/eb7bfe7d-8fa4-4faf-8563-13ae8b04346d/microsoft-query-could-not-be-started-because-it-isnt-installed?forum=excel (It
    also applies to Excel 2013)
    Regards,
    George Zhao
    TechNet Community Support

  • [Oracle 8i] Query for N rows by column value?

    I was just wondering if what I want to do is possible within my query (rather than programmatically)...
    I want to return the N most recent records for each unique value in a particular column.
    Here's a sample table:
    CREATE TABLE     orders
    (     order_no     numeric(10)
         part_no          varchar(5)
         close_date     date
         order_qty     numeric(10)
         scrap_qty     numeric(10)
         CONSTRAINT order_pk PRIMARY KEY (order_no)
    );And some sample data....
    INSERT INTO     orders     VALUES
    (0000012345,'ABC-1',TO_DATE('01-01-2010','mm-dd-yyyy'),10,1);
    INSERT INTO     orders     VALUES
    (0000013498,'ABC-1',TO_DATE('01-05-2010','mm-dd-yyyy'),12,2);
    INSERT INTO     orders     VALUES
    (0000033452,'ABC-1',TO_DATE('01-10-2010','mm-dd-yyyy'),5,0);
    INSERT INTO     orders     VALUES
    (0000001468,'ABC-1',TO_DATE('01-15-2010','mm-dd-yyyy'),15,1);
    INSERT INTO     orders     VALUES
    (0000022349,'BR723',TO_DATE('01-03-2010','mm-dd-yyyy'),8,1);
    INSERT INTO     orders     VALUES
    (0000069581,'BR723',TO_DATE('01-05-2010','mm-dd-yyyy'),5,0);
    INSERT INTO     orders     VALUES
    (0000436721,'BR723',TO_DATE('01-10-2010','mm-dd-yyyy'),14,1);
    INSERT INTO     orders     VALUES
    (0000213446,'A5001',TO_DATE('01-06-2010','mm-dd-yyyy'),5,1);
    INSERT INTO     orders     VALUES
    (0000327987,'A5001',TO_DATE('01-08-2010','mm-dd-yyyy'),5,0);
    INSERT INTO     orders     VALUES
    (0000041353,'A5001',TO_DATE('01-14-2010','mm-dd-yyyy'),12,1);
    INSERT INTO     orders     VALUES
    (0000011241,'A5001',TO_DATE('01-15-2010','mm-dd-yyyy'),5,1);In this example, what I want to return are the 2 most recent orders (by close_date) for each part number.
    Here is a table with the results I want to get, based on the scenario above:
    order_no     part_no          close_date     order_qty     scrap_qty
    0000001468     'ABC-1'          '01-15-2010'     15          1
    0000033452     'ABC-1'          '01-10-2010'     5          0
    0000436721     'BR723'          '01-10-2010'     14          1
    0000069581     'BR723'          '01-05-2010'     5          0
    0000011241     'A5001'          '01-15-2010'     5          1
    0000041353     'A5001'          '01-14-2010'     12          1Is it possible to write a query to get these results, or am I going to have to query for all available data, and find the 2 most recent rows programmatically?
    Thanks in advance!

    Hi,
    user11033437 wrote:
    I'm going to test that out right now. I think if it works, I may need to use dense_rank() rather than rank(), because it is possible that two orders for the same part number could have the same close date, and according to what I've looked up on the rank() and dense_rank() functions, rank() can give non-consecutive results if the values are the same.What's wrong with non-consecutive values?
    Use RANK, DENSE_RANK or ROW_NUMBER depending on what you want.
    For example; say a certain part has been ordered 8 times:
    3 times with close_date January 29, 2010 (all at exactly the same time),
    4 times with close_date January 28, 2010 (all at exactly the same time), and
    1 time with close_date January 27, 2010.
    If you ask for the last 2 rows:
    RANK will give you the 3 rows from January 29. (All 3 have an equal claim to being in the top 2.)
    DENSE_RANK will give you the 7 rows from January 28-29 (the last two values , regardless of how many rows have them).
    ROW_NUMBER will give you 2 rows from January 29. (Which 2? It's arbitrary unless you add a tie-breaker to the ORDER BY clause.)
    All these functions are available in Oracle 8.1.

  • How to model query for -- existing and unchanged values

    Hello BW Experts,
    I have material and material group as navigational time-dependent attributes. I have a requirement to show the existing and unchanged values for the material and material group in the time frame 2003 to 2006 . how to create a query for this.
    Suggestions appreciated.
    Thanks,
    BWer

    HI ,
    I think u need to add two more date fields as the attributes  to the master data and then use them and give restriction in the query with the Keydate to see data which has unchanged from One range to another . As key Date applies to only the system defined to and from dates present in the Master Data .
    In query give Keydate as 31.dec.2006 and then give restriction for user defined dates sa follows :
    User From : 01.01.1000 - 31.12.2002.
    User To : 01.01.2007 -- 31.12.9999 .
    Regards,
    Vijay.
    Message was edited by: vijay Kumar
    Message was edited by: vijay Kumar
    Message was edited by: vijay Kumar

  • Query for releasing and closing Production order ststus in bulk

    Hi
    Releasing planed to released
    1. i want to release all those production orders entered in system which are in planned status.I want to apply one query for that which should change the status of Prod orders to release in systems automatically by applying this query.Please give me that suitable query and how to use it for proper result.
    closing released to planned
    2. Same like above i want to close all those Production orders whose receipt quantity is equal to planned quantity. i.e i want one query which should change the status of production order from release to closed on condition that receipt quantity is equal to the planned quantity.Please give me that suitable query and how to use it for proper result.
    Thanks

    For point 1 and 2:  It should not be tried and using a Query does not comply with SAP Support policy.  Doing so would lead you to lose SAP Support.

  • Hi in my sql query i applied like condition (like '%TEST') but it is taking long time

    Hi in my sql query i applied like condition (like '%TEST') but it is taking long time. I applied indexes also,but still i'm facing the same problem. In my databse nearly 2,00,000 records their.

    Hi Manikandan
    Is there a difference in performance between running the query in BEx and WebI?
    have you aggregates in place on the BEx side of things?
    When you say its taking too long to open the report, have you a variable screen coming up for the report and is that what is taking the time or is it the report execution.
    With regards
    Gill

  • For applying patch 8587502

    Hi,
    For applying patch 8587502:R12.IBY.A on 12.0.6 there is a per-req 7533081:R12.AR.A which is Obsolete and replacement is 7828946.
    7828946 is cpc jul09 and is not in my AD_BUGS table.
    How to make sure weather i need to apply this or i have cpc applied heigher than this.

    Hi;
    For applying patch 8587502:R12.IBY.A on 12.0.6 there is a per-req 7533081:R12.AR.A which is Obsolete and replacement is 7828946.
    7828946 is cpc jul09 and is not in my AD_BUGS table.Did you try to query ad_applied_patches ?
    How to make sure weather i need to apply this or i have cpc applied heigher than this.If you are on higher level i belive you can skip this patch.If you have test instance wiht same level of your prod, try to apply patch. If you have this patch you will get warning as this patch exists on your system
    Regard
    Helios

  • How to write SQL query and apply aggregate functions on it

    Hello experts,
    Iu2019ve a task to write SQL query on tree tables and do inner join on them. Iu2019ve accomplish this task by using T-CODE SQVI. However now I need to write a query and apply SQL functions on it i.e. Add, Count, Max and Min etc. Please can someone tell me how I can write SQL query with aggregate functions in SAP?
    Thanks a lot in advance

    HI Mr. Cool
    you can see the below code for using aggregate functions.
    where ARTIST and SEATSOCCU are the field names for which you want to perform these functions.
    DATA: TOTAL_ENTRIES TYPE I,
          TOTAL_ATT TYPE I,
          MAX_ATT TYPE I,
          AVG_ATT TYPE I.
    SELECT COUNT( DISTINCT ARTIST )
           SUM( SEATSOCCU )
           MAX( SEATSOCCU )
           AVG( SEATSOCCU ) FROM YCONCERT INTO (TOTAL_ENTRIES, TOTAL_ATT,
    MAX_ATT, AVG_ATT).
    Thanks
    Lalit Gupta

  • Please help to modifiy this query for better performance

    Please help to rewrite this query for better performance. This is taking long time to execute.
    Table t_t_bil_bil_cycle_change contains 1200000 rows and table t_acctnumberTab countains  200000 rows.
    I have created index on ACCOUNT_ID
    Query is shown below
    update rbabu.t_t_bil_bil_cycle_change a
       set account_number =
           ( select distinct b.account_number
             from rbabu.t_acctnumberTab b
             where a.account_id = b.account_id
    Table structure  is shown below
    SQL> DESC t_acctnumberTab;
    Name           Type         Nullable Default Comments
    ACCOUNT_ID     NUMBER(10)                            
    ACCOUNT_NUMBER VARCHAR2(24)
    SQL> DESC t_t_bil_bil_cycle_change;
    Name                    Type         Nullable Default Comments
    ACCOUNT_ID              NUMBER(10)                            
    ACCOUNT_NUMBER          VARCHAR2(24) Y    

    Ishan's solution is good. I would avoid updating rows which already have the right value - it's a waste of time.
    You should have a UNIQUE or PRIMARY KEY constraint on t_acctnumberTab.account_id
    merge rbabu.t_t_bil_bil_cycle_change a
    using
          ( select distinct account_number, account_id
      from  rbabu.t_acctnumberTab
          ) t
    on    ( a.account_id = b.account_id
           and decode(a.account_number, b.account_number, 0, 1) = 1
    when matched then
      update set a.account_number = b.account_number

  • Htree - many hours later still getting "invalid query for htree"

    I'm using the Pre_Form trigger ftree.populate_tree('HTREE_BLK.TREE4'); and the query you see below. I am still getting "FRM-47313: Invalid query for the hierarchical tree". I must be missing something because I don't see what is wrong with the query.
    greg
    SQL> select
    2 decode(level, 1, 1, -1)
    3 ,level
    4 ,description
    5 ,null
    6 ,menu_id
    7 from htree_menu
    8 start with belongs_to is null
    9 connect by prior
    10 menu_id = belongs_to;
    DECODE(LEVEL,1,1,-1) LEVEL DESCRIPTION N MENU_ID
    1 1 Retired Profit Sharing System 1
    -1 2 Screens 2
    -1 3 Main 5
    -1 3 Search 6
    -1 2 Processing 3
    -1 3 Apply Interest 7
    -1 3 Calculate Quarterly Payments 8
    -1 3 Six Month Projections 9
    -1 2 Reports 4
    -1 3 Summary Report 10
    -1 3 Monthly Payments 11
    DECODE(LEVEL,1,1,-1) LEVEL DESCRIPTION N MENU_ID
    -1 3 Participant Listing 12
    -1 3 Participant Quarterly Report 13
    -1 3 Six Month Projection 14
    14 rows selected

    I tried this select on the SCOTT schema:
    select decode(level,1,1,-1),level,ename,null,empno from emp connect by prior empno=mgr start with mgr is null
    In a pre-form in Oracle9i Forms and it works for me.
    Check this select in your case.
    Make sure that you don't have any extra characters in the select (";")

  • Query for Alert on production order to be released

    Dear all users and experts,
    I need a query for getting an alert on production orders to be released (from planned status to release status) by whether reading the release date of production orders created from 'order recommendation window' or by reading the due date of production order and substract the lead time(days) of the item from its due date or by any means you know best.
    Thanks and best regards,
    Farhan Sufi

    Hi Gordon and Joseph,
    Thanks to both of you for giving me queries.
    Gordon, I made 3 production orders for testing from MRP order recommendation window from which 2 production orders has release date of today 9th July, 2010 (due date 12th July monday) and the 3rd one has release date of after weekend i.e. 12th July 2010 (due date is 13th July). release dates are calculated by MRP acording to the items' lead time and due date.
    Gordon, when I applied your query It gave me msg 'no data was found as a result of this selection criteria' Can you explain what your query will give me in result?
    where as Joseph, when I applied your query on alert, it gave me all 3 production orders as an alert to be released. I was expecting it will give me alert for 2 production order for today as their release date in MRP is today(9th July, 2010) and the alert for 3rd production order should come on 12th July and not today.
    what I understood your query is displaying all production orders which have status 'planned' regardless of their release date.is it?
    Joseph can you edit this query in such a way that It should consider the release date (calculated from due date and lead time in MRP order recommendation window) and display only those production orders which should be released today and exclude those which have release date in future. so that I can get alert for only those production orders which should be released today.
    I hope good response from both of you
    Thanks and best regards,
    Farhan

  • Approval Query for AP Invoices Containing Budget Related GL Account

    Hi Experts,
    I would like to create a approval template for all AP invoices that include a GL account that is related to the budget. Can you please help me with the approval query?
    Thank you!
    Jane

    Hello Gordon Du,
    "B1 approval will only apply to document level. If you want to check line level, only the first line can be subjected to."
    I was thinking to trigger the approval process based on a document (AP invoice) containing relevant cost centres on a line by line basis as entered via one of the enabled dim fields.
    Writing a trigger query for each cost centre effected? This does not appear to be a good solution, what is a better direction. Is there another way? (PO are not yet used via SAPB1)
    Currently my invoices add, but do not trigger the approval process based on my attempts thus far.
    Can the originator manually choose an approval pathway?
    If this is against posting etiquette delete and advise.
    I am a relative newbie to SAP B1, so am happy to be pointed to relevant help files. I arrived via  google searching and arrived here.
    Thankyou.

  • Use Trigger or Query for Deltas

    Hi Gurus,
    It has come up that my boss wants us to use a trigger on one of the most critical talbes we use for our website. Instead I have suggested to query for deltas and feed them out on time intervals.....which method is the least performance impacting on our db?
    Any info/suggestions would be much appreciated.
    S

    Hi,
    ScarpacciOne wrote:
    When is it a good idea to use triggers? What scenarios are a good fit to implement a trigger?DML triggers are great for autiomatically supplying or correcting data entry.
    For example, supplying an id number from a sequence when a new row is inserted, or filling in last_modify_date and last_modify_user columns.
    Sometimes you can autiomatically correct data entry errors. For example, if a string is supposed to be all upper-case, or a DATE column is supposed to be midnight. You can (and should) have CHECK constraints to make sure people don't enter bad data, but sometimes you can safely say "I'm sure he meant 'ACTIVE', even though he said 'active'", or "I'm sure she meant TURNC(SYSDATE), not SYSDATE", and avoid having any error.
    DML triggers are the only way to ensure something is done the as soon as some DML is performed. If it can wait, even a few minutes, then some othe mechanism (like a scheduled job, or a materialized view) can probably handle the situation more easily and reliably.

Maybe you are looking for

  • Creative Cloud is experiencing unexpected server errors...

    Anyone else getting this message when accessing files on the website? This section of Creative Cloud is experiencing unexpected server errors. We're working quickly to resolve the issue and we're sorry for the delay. Please check back or see our stat

  • Creating new String using only specific set of chars from another String

    I've performance troubles doing this task: I have a very long String A (up to 1 million character length) This String contains different characters. I need to create a String B containing only specific characthers (with a defined character code) An e

  • Header is coming as vertical in downloaded pipe dilimiter file

    Hi , I have a requirement where i hav to download the pipedelimiter file to presentation server, for which im Using "GUI_DOWNLOAD".i collected the field names of the table using "ALV_FIELDCATALOG_MERGE" and passing this internal table as "i_header" t

  • MDM Java API Samples Framework

    hi MDM experts, I need MDM Java API Samples Framework.zip  file its urgent help me thanks ram.

  • [SOLVED]Boot hang after recent updating issues

    I am having issues after the last update. First, I made a mistake of holding back the filesystem package. Because of this (at least I think so) I was having an error that said it could not boot because at boot it said "/sbin/init does not exist". I s