Add date filter to recordset

Is it possible to add some filters to a paged dataset?
One of the columns is date, its in unix format, and isn't displayed, the pretty date is in a visible column. I want to have 3 check boxes:
1. Expires within 3 months
2. Expires within 2 months
3. Expires within 1 month
I have been reading this: http://labs.adobe.com/technologies/spry/samples/data_region/MultipleFiltersSample.html
And realise that I need to write something like this:
function ff1(ds, row, index){ var c = row.name.charAt(0); return c >= 'A' && c <= 'H' ? null : row; };
But due to knowing very little about JavaScript I am not sure how to do the date comparison.
Can Javascript handle unix dates?
Each filter will be something like this:
show records where daterow is between today and today minus 3 months
show records where daterow is between today and today minus 2 months
show records where daterow is between today and today minus 1 month
Can anyone help?
Cheers,
Steve

Hmph, I may have to abandon this filter, the performance is dire. It takes over 3 seconds to filter a list of 22 records, thats with none matching the filter. If I use a list with 230 rows it crashes the browser.
I do have a keyword filter on this list as well, you type in part of a keyword and it filters it straigh away, even the 230 long list. Why mine is killing the performance I really don't know.
This is my current filter:
function filterExpire90(){
     var today = Date.today(), expire = Date.today().add(-90).days();
     function filterDate90(ds, row, index){
          var c = Date.parse(row["lastdate"]).add(1).years();
          return c.between(expire, today) ? row : null;
      // filter
     dsHoists.filter(filterDate90);
And this is the faster filter from the Labs example:
function FilterData()
    var tf = document.getElementById("filterTF");
    if (!tf.value)
        // If the text field is empty, remove any filter
        // that is set on the data set.
        dsHoists.filter(null);
        return;
    // Set a filter on the data set that matches any row
    // that begins with the string in the text field.
    var regExpStr = tf.value;
    //if (!document.getElementById("containsCB").checked)
        //regExpStr = "^" + regExpStr;
    var regExp = new RegExp(regExpStr, "i");
    var filterFunc = function(ds, row, rowNumber)
        var str = row["serial"];
        if (str && str.search(regExp) != -1)
            return row;
        return null;
    dsHoists.filter(filterFunc);
function StartFilterTimer()
    if (StartFilterTimer.timerID)
        clearTimeout(StartFilterTimer.timerID);
    StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID = null; FilterData(); }, 100);
Steve

Similar Messages

  • Need to personaliza table to add data filter

    I have developed a custom page with 2 buttons and a simple table.
    I need to personalize the page to add data filters. I tried to do the same by clicking on the Query personalize link for the table personalization.
    The Create Query page opened up, but the data filter section shows the following
    Data Filter
    No data filters can be created for this region.
    Can somebody throw some light on this.
    Thanks in Advance

    What data you need to filter???
    Thanks,
    Gaurav

  • Can you use a php variable to filter a recordset?

    I've got a table of 'events', which have a description and
    more importantly for this a month ID number. (1-12 for the months
    of the year, when the event takes place) .
    I've used php's date function on a page to fund out
    numerically what month it is now $thismonth = date("n");
    i want to filter my recordset by only bringing up events that
    take place during the current month so where event_month =
    $thismonth
    IS this possible? It seems like it should be easy to do but I
    can't get it to work.
    Thanks in advance
    Dave

    jnkjnkjnkjnkjn wrote:
    > i want to filter my recordset by only bringing up events
    that take place
    > during the current month so where event_month =
    $thismonth
    >
    > IS this possible? It seems like it should be easy to do
    but I can't get it to
    > work.
    Yes, it's very easy, but you need to do a little hand-coding.
    In the
    Advanced recordset dialog box set the end of the SQL query to
    WHERE
    event_month = 1. When you have saved the recordset, change
    the SQL to
    WHERE event_month = $thismonth.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • How to add data through matrix from sales order row level to

    user defined document type table ...
    i created matrix in user defined form, i placed one edit text box on that form
    when i entered docnum of sales order the data of sales order row level should have to
    upload to matrix , after fill up the some data in matrix that data should have to add to the user defined document type table
                                any one have code pls post it
                                            thanq

    Hi rajeshwar
    Here is a sample function related to ur senario. just check it out and use the concepts.
    Here I have used a CFL to get the itemcode and I have used a query to  add data to matrix.
    This is a function used.
    Private Sub AddValuesInMatrix(ByRef name As String)
            Try
                'Dim quantemp As Double
                oForm = SBO_Application.Forms.Item("itemdts")
                oMatrix = oForm.Items.Item("matrix").Specific
                Dim rs As SAPbobsCOM.Recordset = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                '//gitemdesc = "SELECT T0.[ItemName] FROM OITM T0 WHERE T0.[ItemCode] ='" & name & "'"
                oMatrix.Clear()
                rs.DoQuery("SELECT T0.[DocEntry], T0.[ItemCode], T0.[Dscription], T0.[Quantity], T0.[Price], T0.[TaxCode] FROM dbo.[POR1] T0 WHERE T0.[ItemCode] ='" & name & "'")
                rscount = rs.RecordCount
                If (rscount < 1) Then
                    SBO_Application.StatusBar.SetText("No Items Found", SAPbouiCOM.BoMessageTime.bmt_Short)
                Else
                    oForm.Freeze(True)
                    ITE = True
                    For i As Integer = 1 To rs.RecordCount
                        oMatrix.AddRow()
                        oMatrix.Columns.Item("V_5").Cells.Item(i).Specific.Value = rs.Fields.Item("DocEntry").Value
                        oMatrix.Columns.Item("V_4").Cells.Item(i).Specific.Value = rs.Fields.Item("ItemCode").Value
                        oMatrix.Columns.Item("V_3").Cells.Item(i).Specific.Value = rs.Fields.Item("Dscription").Value
                        oMatrix.Columns.Item("V_2").Cells.Item(i).Specific.Value = rs.Fields.Item("Quantity").Value
                        'quansum = quansum + rs.Fields.Item("Quantity").Value
                        oMatrix.Columns.Item("V_1").Cells.Item(i).Specific.Value = rs.Fields.Item("Price").Value
                        'pricesum = pricesum + rs.Fields.Item("Price").Value
                        oMatrix.Columns.Item("V_0").Cells.Item(i).Specific.Value = rs.Fields.Item("TaxCode").Value
                        SBO_Application.SetStatusBarMessage("Data Loading In Progress Please Wait.....>>> " & i & " / " & rs.RecordCount, SAPbouiCOM.BoMessageTime.bmt_Short, False)
                        rs.MoveNext()
                    Next
                    ITE = False
                    oMatrix.AutoResizeColumns()
                    SBO_Application.StatusBar.SetText("Data Loading Completed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success)
                    oForm.Freeze(False)
                    oForm.Refresh()
                End If
            Catch ex As Exception
                SBO_Application.MessageBox("Matrix Load Function : " & ex.Message)
                ITE = False
            End Try
        End Sub
    -Anto

  • Table date filter not working properly

    Hi OTN,
    I have noticed that table date filter not always working properly.
    When I copy actual value from column outputText to column filter and hit Enter - I see an empty table.
    http://imageshack.us/photo/my-images/818/filter.png/
    I suspect the problem to lie among date formats.
    But I tried to delete convertDateTime from outputText or add it under filter inputDate. Nothing helped.
    <af:column sortProperty="Hisdate" sortable="true"
                                     headerText="#{bindings.InformationView1.hints.Hisdate.label}"
                                     id="c8" visible="false" filterable="true"
                                     width="83">
                            <af:outputText value="#{row.Hisdate}" id="ot5">
                              <af:convertDateTime pattern="#{bindings.InformationView1.hints.Hisdate.format}"/> // or without both lines
                            </af:outputText>
                            <f:facet name="filter">
                              <af:inputDate id="id15"
                                            value="#{vs.filterCriteria.Hisdate}"
                                            columns="8">
                                <af:convertDateTime pattern="#{bindings.InformationView1.hints.Hisdate.format}"/> // or without both lines
                              </af:inputDate>
                            </f:facet>
                          </af:column>Nothing special about the attribute. A database table field of type DATE. In database this (see picture) row has exactly "06.06.2006".
    Could you please point me out where to start seeking?
    Thanks.
    JDev 11.1.1.4

    Well, OK. I think I'd better have 2 attributes: truncated date for filter and full date with time for edit.
    What is an attribute type for datetime?
    select trunc(t.HISDATE) AS HISDATE -- date attribute type
        ,to_char(t.HISDATE, 'dd.mm.yyyy hh24:mi') AS HISDATETIME -- timestamp/date attribute type?Something like this?

  • Date filter in preview

    Hi there,
    Can anyone help me to see the error of my ways with date filters when using Preview and Designer to create reports.
    If I create a Excel 2013 workbook with date filter on Power View they appear as they do in Excel and the current version of Power BI (O365 Add on)... see first Pic below.
    If I use the Power BI Designer, or create a Report in the Preview the only filter 'structure' applied to dates is the checkbox structure for each date, and it's not functional either as the list of dates only shows approximately 30 instead of each day for
    the last 5 years (which is the content of the data)...  see second pic below
    I was expecting any date filters to show as per the first Pic in all cases.
    Is this just a bug??
    Expected to see (uploaded Excel 2013 Workbook):-
    but we see this (using the same model from the uploaded workbook):
    The Power Query has the column 'added' defined as a date.
    Thanks,
    Tim
    Thank you for you time folks!

    Hi Bruno, thanks for the reply to the post.
    The issue here is the way in which the UI works with this amount of data.  So there are 1600 dates I'm the model and the UI only shows a small list of the dates.  And you can't change the filter 'type' to allow rhea selection for a range of dates
    like you can in the Excel 2013 Power View.  This is odd because when you upload the Excel created Power View the functionality exists in the Power BI UI.
    The issue is when using a date as a filter you can't appear to select the type of filter to allow the entry of a date range.  This just appears odd, or a bug?? i'm going to use the good old date dimension table to allow the selection but most end users
    of Power BI won't have rhe knowledge or the skills to build star or snow flakes... therefore this seriously restricts functionality in my view...
    Hope MS resolves soon...
    Thanks again.  tim
    Thank you for you time folks!

  • How to Add a filter option for a entire table to a search button?

    Hi all,
    I am new to SAPUI5. i am having a table with hard coded data's.and i have a search field.
    i want to add a filter option to the search field for the entire table..
    i can able to add a filter option to the column by using filterProperty.
    is there is any method or property to do that?
    PS - i have attached my table code.
    Regars
    Dayalan

    Hi Dayalan,
    documentation for filtering and sorting is in this section of the Developers Guide.
    Cheers
    Graham Robbo

  • Data Filter issue with

    Hi,
    We have created a document from an Essbase ASO cube.
    A data filter have been created in Essbase ASO Cube. The data filter is 'all Europe Region'. When this data filter is applied to the user and user logs in WA and accesses the document, the below error is produced.
    ========================================================
    Loading this document produced errors.
    Unknown members or dimensions have been removed from the document in an attempt to fix the problem.
    Saving this document now will prevent these errors when the document is loaded again.
    [1033] Native: 1001005 [Fri Mar 06 16:59:20 2009]uxsy9dbt.cos.agilent.com/vip_main/vip_main//Error(1001005) Unknown Member [Americas] in Report
    ==============================================
    With no data filter assigned to the user, the report is fine...
    Tested the same data filter in Excel-addin and there are no issues/error. Is there any setting that needs to be changed in WebAnalysis?

    Following up even thought his is an old issue. Out of the blue my users began complaining their security in Web Analysis had gone awry. Their security in Excel add-in was fine though.
    Most users use a WA Shared Preferences File here. However one user, unbeknownst to me, was able to hard code their userID/password in the "database" connection for the Shared Preference. So anytime another user logged in to Web Analysis, if you open the View Pane to see all the details, the Database user was John Doe - which was wrong, but the WebAnalysis user was John Smith - which was correct. The John Doe user like I said somehow managed to "save" his userID/pwd as the default, which caused all other users to "pass through" to Essbase as John Doe instead of as themselves, which means they were getting HIS filter not their own.
    I wasn't able to figure out how he did that but to fix it I deleted his profile then Edited the Shared Preferences File | Databases tab | highlight database in question and choose Edit | change "Default logon" back to "Use User's ID and Password" instead of "Enter User ID and Password...John Doe|Pwd".
    It works fine now. Users get their same, correct security filters applied whether they go in to Web Analysis or Excel add-in. (In Web Analysis we have it set up to open a report at a certain location depending on their security filters, so this was causing us quite a headache until we figured out what the problem was).
    I opened a case with Tech Support to try and shed light on how the user was able to hard-code their login credentials in to the Shared Preference. Everyone only has Read access to that file, so. ?
    HTH,
    Karen S.

  • Date Filter Error

    Hi,
    I create a report (columnar) with date filter, but when i try use the filter this error ocurrs:
    ADC Server exception in OpenViewset().
    ADC Server exception in OpenViewset(). [ErrorSource="ActiveDataCache", ErrorID="ADCServerException"] ERROR [42000] [Microsoft][ODBC driver for Oracle][Oracle]ORA-00911: invalid character [ErrorSource="msorcl32.dll"]
    The filter is "FIELD_DT is greater than 10/1/2009 12:00:00 AM".
    The DO is vinculated a External Data Source, and the field used is datetime type.
    I use BAM 10.1.3.3.0.
    Please, help-me.

    Hi,
    It is difficult to say from error message whether the problem is due to filter or some other condition in the report. If you suspect it is filter, can you please create a simple Updating Ordered List on the dataobject you are using to see if works and when you find it working, add the exact filter on it and then we would know if filter has issues?
    Thanks,
    Vishal

  • Subtotal on Ytd column changes when adding a date-filter

    Hi everybody,
    I am facing a challenge in BIEE which I can't explain.
    BI Server version: 10.1.3.4.1 Build 090414.1900
    Using Sample Sales Reduced
    I've defined the following request
    Columns:
    Region, Year, Month, Day Date, Revenue, Year to Date Revenue (Aggregation Rule: Server Complex Aggregate)
    Filter:
    Year = 2008
    and month = 2008/01
    and region = East
    Results shown in a table view and adding a subtotal on month
    Revenue column: 428261.97
    Year to Date Revenue: 428261.97
    The challenge:
    Adding the following filter
    Day Date <= 1/31/2008
    leads to the following subtotals
    Revenue column: 428261.97
    Year to Date Revenue: 6867366.46
    The subtotal in Year to Date Revenue is now a total of all the values (aggregation rule is still Server Complex aggregate) and I can't get back to the correct number as long as the Day Date filter exists. I would have expected the 428261.97 as the subtotal.
    Is there anything I've misunderstood?
    Thanks for your help
    Regards
    Andy

    Hi Andy,
    Other than equal to/is in filter if u apply u ll get *6,867,366.46* ....why because its dividing the data for all the day date that u mentioned let say less than 31st jan -08....if u want to get *428261.97* remove the extra filter
    have u seen the formula for YTD column ? ( TODATE("Sample Sales"."F0 Rev Base Measures"."1-01 Revenue (Sum All)", "Sample Sales"."H0 Time"."Year"))
    from the formula ,Less than equal to means it ll consider all the dates and add up the revenue then how come you will get 428261.97?
    thanks,
    Saichand.v

  • Create a date filter..

    I'm trying to create a report with two filters: Year and Date to...
    So the user can select
    Year: 2008
    Date to: 2008-08-01
    And in the report must be filter by date between first day of the year filter and Date to...
    So I will add a filter view and for 2008 and 2008-08-01 I expect to see:
    date between 2008-01-01 and 2008-08-01
    I been playing with presentation variables and with SQL Expression filters putting thinks like this: timestamp CONCAT('@{Year}','-01-01 00:00:00') but does't work...
    Any Idea?
    Thanks...

    Try this
    cast('01-jan-' || cast(@{Year}{2010} as varchar(4)) as date)If in Database features in phisical layer in repository the CAST_SUPPORTED is checked then it sends the cast job to the database
    and the default converion of string into date in Oracle is '01-jan-2000' string format...
    If CAST_SUPPORTED is not checked then it uses the format from NQSConfig.ini
    DATE_TIME_DISPLAY_FORMAT = "yyyy/mm/dd hh:mi:ss" ;
    DATE_DISPLAY_FORMAT = "yyyy/mm/dd" ;
    TIME_DISPLAY_FORMAT = "hh:mi:ss" ;Regards
    Nicolae
    P.S.
    If you find this usefull please be free to award points...

  • Automatic Data Filter??

    Dear Friends
    I have Oracle 10g forms, and i would like to add an automatic filter on the fileds, so each time the user enters charcater the results must be filterd, like when you want to add new trigger in oracle forms for example when you type "W" all words started by "W" kept in the menu and other deleted.
    can i do that in oracle form???
    thank you in advance
    Best Reagrds
    Mohammad

    Dear Friends
    I have found a good way to do automatic data filter, we can achieve this goal by using combo list, and put (when_list_changed) trigger on this list, to do the query on the specified block. and as the user enters characters and the data in blocks will be filtered instantly.
    i found it, and i thought that can help another users.
    best regards
    Mohammad

  • Create prompt with date-filter and initialize it with current date

    Oracle BI 11 g
    Hi!
    I need to create dashboard prompt with date-filter and initialize it with current date. How can I do that?
    I tried to create repository initialization block and add variable. But I don't know what should I write to DataSource? I tried to use functions Now(), Current_Date, sysdate (for example, SELECT Now() FROM tbl_Calendar) but without results - when I pressed "Test..." button I got errors - something like "Now() is unknown function" or "Incorrect syntax near key word Current_Date".
    After that I tied to use Presentation Variable in Prompt, but also without success ((
    Please, help me.

    I've created Repository Variable "CurrentDate", using SQL-query like this "select convert(varchar(10), getdate(), 104)" and now this variable is being initialized by value "07.04.2011". But I don't understand how to use this varible in DashboardPrompt! What item in list "Default selection" I should choose - "Variable Expression", "Server Variable" or something else? When I chose "Variable Expression" and write "CurrentDate" I got just string "CurrentDate" when preview Prompt. @{CurrentDate} gave me the same result.

  • Use Date Filter WebParts for Date Range In Sharepoint 2013

    Hi,
    Can someone please explain how to use the Date Filter WebParts in Sharepoint 2013 to act as a Date Range. Myrequirement is exactly like in the link
    Date Filter but this is not working on Sharepoint 2013 Designer. I am unable to edit a webpart page in Designer, add and configure these webparts.
    Request you to please help!!

    Now/Today probably isn't supported because it simply cannot work the way most people (including myself) would like for it to work.  The calculation only executes when an item is created or updated.  It does not recalculate when you view or retrieve
    the value (say through a workflow) from the field.  Because of this, "Today" would be misleading as it doesn't really mean today, but the last time the field was recalculated (created/updated).
    If the recalculation occurred each time the field was accessed or viewed, that would be of tremendous benefit.

  • How to add a filter like TIME NOW() - {interval}

    How to add a filter like
    TIME > DATEADD(Now(),0,0,0,0,0, -[PARAMETER:interval],0)
    where TIME is a field, interval is paramter in seconds (may > 60)
    or
    a calculated field:
    TIME2=DATEADD(TIME, 0,0,0,0,0,[PARAMETER:interval],0)
    and a filter
    TIME2<Now()
    or a filter
    TIME is within a time interval previous [PARAMTER:interval] minutes

    DateAdd(receiveInput_TS,0,0,0,1,0,CreditTime,0)
    Using the same example in the PDF (data object layout) - the above "formula" worked for me. Note that if you use the above formula - it would be evaled only once, not periodically at every 5 secs or so. In order to achieve -real-time-alert-evaluation- you have to use 'ActiveNow' with the timefield in "alert"
    Alternate - the above calculation also worked correctly in the ADC dataobject layout design as calculated field. But again it will be evaluated only if the data in 'that' row changes.

Maybe you are looking for

  • Activation error in AME CS6 on Mac

    I have four user IDs on my Mac: my everyday user account, another account for my wife, a guest account, and a root account. Today I was using AME in my regular account and it worked fine. Then I switched by my wife's account (I quit AME in the regula

  • Retrieving XMLType using JDBC(THIN DRIVER)

    Oracle Database: 10g R2 Java version: 1.4+ Hi All, I have a column of type XMLType in a database table . I have to retrieve it using Oracle XDK APIs as an instance of oracle.xdb.XMLType. How to go about this using thin driver? Thanks

  • Glitched video preview!

    This is really annoying, after trying the 30-day-trial I went and bought the softwere (Adobe Premiere Pro CC 2014). Why doesn't the video preview work anymore? It only works when the video is playing but when I stop to fine tune my edit this happens:

  • 9800 torch

    Hi there can any one help me I baught a torch 9800 but can't download any media files but software is good and running I do have sufficiant memory but still don't know what's wrong so can any one help me or atleast tell me what steps I should take to

  • IPhone adapter for charging iPad mini

    If I use iPhone 4S adapter for charging my iPad mini, will it be able to cause damages to my iPad battery?