Timestamp & data point search

I should preface this by saying I only have read only access to this Oracle SQL database and I'm using TOAD.
looking for a query to find data points where two types of data points exist
So I have 4 columns: STID(id of device), CASE_SAK(unique id), timestamp(in form MM/DD/YY HH:MI:SS AM or PM), and COMMAND_ID.
COMMAND_ID has three types of data in it: EOL_READ, ODO_READ, and PREDICTION
Any time there is a reading there are 1 of 4 possibilities occur.
I can get EOL/ODO/PREDICTION, EOL/ODO, or EOL, or ODO
example:
COLUMNS: STID, CASE_SAK, timestamp, COMMAND_ID
ROW # 1: 2545, 100, 8/20/2006 12:00:00 AM, EOL_READ
ROW # 2: 2545, 100, 8/20/2006 12:00:00 AM, ODO_READ
ROW # 3: 2545, 100, 8/20/2006 12:00:00 AM, PREDICTION
ROW # 4: 3125, 101, 8/21/2006 12:01:00 AM, EOL_READ
ROW # 5: 3125, 101, 8/21/2006 12:01:00 AM, ODO_READ
Now I would like to query where exists a timestamp for each month in the last 6 months because these are monthly readings and I need to give only the data where there is a reading in each of the six months(no nulls) from the beginning of this month and going back 6 months, and I also need to only pull those cases where exists both an EOL_READ and an ODO_READ at the very least, but I also need to pull a PREDICTION as well where it exists. I am scratching my head on this one.
In addition I need to pull at first only 1000 unique STIDs, and then I need to plug in the 1000 STIDs into the same query for the future.
I realize this is a lot to ask the board, but any help or ideas would be greatly appreciated.

Not sure if this fully meets your requirements but it should be close;
create table query_results(stid number, case_sak number, time_stamp timestamp, command_id varchar2(20));
with test_data as (  -- middle 6 months of data qualifies 
   select 2545 stid, 100 case_sak, to_timestamp('07/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM') time_stamp, 'EOL_READ' command_id
      from dual union all
   select 2545, 100, to_timestamp('08/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2545, 100, to_timestamp('09/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2545, 100, to_timestamp('09/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2545, 100, to_timestamp('10/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'PREDICTION' from dual union all
   select 2545, 101, to_timestamp('11/21/2006 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'EOL_READ' from dual union all
   select 2545, 101, to_timestamp('12/21/2006 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2545, 101, to_timestamp('01/21/2007 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2545, 101, to_timestamp('02/21/2007 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   -- 6 months of data, no EOL_READ 
   select 3125, 100, to_timestamp('08/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 3125, 100, to_timestamp('09/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 3125, 100, to_timestamp('10/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'PREDICTION' from dual union all
   select 3125, 101, to_timestamp('11/21/2006 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'PREDICTION' from dual union all
   select 3125, 101, to_timestamp('12/21/2006 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 3125, 101, to_timestamp('01/21/2007 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   -- 6 months of data with gap 
   select 1111, 100, to_timestamp('07/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'EOL_READ' from dual union all
   select 1111, 100, to_timestamp('09/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 1111, 100, to_timestamp('10/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'PREDICTION' from dual union all
   select 1111, 101, to_timestamp('11/21/2006 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'EOL_READ' from dual union all
   select 1111, 101, to_timestamp('12/21/2006 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 1111, 101, to_timestamp('01/21/2007 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   -- middle 6 months of data qualifies 
   select 2222, 100, to_timestamp('07/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2222, 100, to_timestamp('08/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2222, 100, to_timestamp('09/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2222, 100, to_timestamp('09/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2222, 100, to_timestamp('09/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2222, 100, to_timestamp('10/20/2006 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'PREDICTION' from dual union all
   select 2222, 101, to_timestamp('11/21/2006 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'EOL_READ' from dual union all
   select 2222, 101, to_timestamp('12/21/2006 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2222, 101, to_timestamp('12/21/2006 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2222, 101, to_timestamp('01/21/2007 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual union all
   select 2222, 101, to_timestamp('02/21/2007 12:01:00 AM','MM/DD/YYYY HH:MI:SS AM'), 'ODO_READ' from dual)
select *
from (
   select
      t.stid,
      t.case_sak,
      t.time_stamp,
      t.command_id,
      count(distinct trunc(t.time_stamp,'mm')) over (partition by stid) month_count,
      count(case when command_id='EOL_READ' then 1 else NULL end) over (partition by stid) eol_read_count,
      count(case when command_id='ODO_READ' then 1 else NULL end) over (partition by stid) odo_read_count
   from test_data t,
      (select trunc(add_months(sysdate, -1 * rownum),'mm') month_id
      from dual
      connect by rownum <= 6) d
   where d.month_id = trunc(t.time_stamp,'mm')
   order by stid, time_stamp, case_sak, command_id
) sub
where month_count = 6
and eol_read_count > 0
and odo_read_count > 0
and rownum < = 1000
and not exists (select 1
                from query_results r
                where sub.stid = r.stid
                and sub.case_sak = r.case_sak
                and sub.time_stamp = r.time_stamp)
order by stid, time_stamp, case_sak, command_id;You may want to make a view out of the query and use it to populate a table that retains the 1000 records that you need. This query assumes that the historical records are stored in a table named query_results. You can drop the test_data selects and replace the table reference in the query with your table. You can also remove the three count columns from the SELECT.
I recommend that you rename the 'timestamp' column as this is an Oracle reserved word and it has caused problems for others in the past.
Message was edited by:
MScallion
Added distinct

Similar Messages

  • How can I connect dots across missing data points in a line chart?

    Hi all!
    I have a table in Numbers that I update every few days with a new value for the current date (in this case body metrics like weight, etc.), which looks something like this:
    Column 1              Column 2      Column 3
    Aug 16, 2011         87.1             15.4
    Aug 17, 2011         86.6
    Aug 18, 2011         86.1
    Aug 19, 2011              
    Aug 20, 2011         85.7             14.6
    Aug 21, 2011         85.3
    Every once in a while there will be a missing value for a given date (because I didn't take a reading on that day). When I plot each column against the date on a line chart, there is a gap where there are missing data points. The line does not connect "across" missing data points. Is there a way to make the line connect across missing data points?
    Thanks for any help. This thing has been driving me nuts!

    Leave your nuts in peace.
    Don't use line charts but scatter charts.
    These ones are able to do the trick.
    Of course to do that you must study a bit of Numbers User Guide.
    In column D of the Main table, the formula is :
    =IF(ISBLANK($B),99999,ROW())
    In column E of the Main table, the formula is :
    =IF(ISBLANK($C),99999,ROW())
    Now I describe the table charter.
    In column A, the formula is :
    =IFERROR(DAY(OFFSET(Main :: $A$1,SMALL(Main :: $D,ROW())-1,0)),"")
    In column B,the formula is :
    =IFERROR(OFFSET(Main :: $A$1,SMALL(Main :: $D,ROW())-1,1),"")
    In column C, the formula is :
    =IFERROR(DAY(OFFSET(Main :: $A$1,SMALL(Main :: $E,ROW())-1,0)),"")
    In column D, the formula is :
    =IFERROR(OFFSET(Main :: $A$1,SMALL(Main :: $E,ROW())-1,2),"")
    In this table, select the range A1 … D5
    and ask for a Scatter chart.
    You will get what you need.
    I asked that points are joined by curves
    I just edited the parameters of Xaxis and Yaxis to get a cleaner look.
    I repeat one more time that knowing what is written in the User Guides is useful to be able to solve problems with no obvious answer.
    Yvan KOENIG (VALLAURIS, France) samedi 27 août 2011 15:59:20
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Neen help with date range searches for Table Sources

    Hi all,
    I need help, please. I am trying to satisfy a Level 1 client requirement for the ability to search for records in crawled table sources by a date and/or date range. I have performed the following steps, and did not get accurate results from Advanced searching for date. Please help me understand what I am doing wrong, and/or if there is a way to define a date search attribute without creating a LOV for a date column. (My tables have 500,00 rows.)
    I am using SES 10.1.8.3 on Windows 32.
    My Oracle 10g Spatial Table is called REPORTS and this table has the following columns:
    TRACKNUM Varchar2
    TITLE Varchar2
    SUMMARY CLOB
    SYMBOLCODE Varchar2
    Timestamp Date
    OBSDATE Date
    GEOM SDO_GEOMETRY
    I set up the REPORTS table source in SES, using TRACKNUM as the Primary Key (unique and not null), and SUMMARY as the CONTENT Column. In the Table Column Mappings I defined TITLE as String and TITLE.
    Under Global Settings > Search Attributes I defined a new Search Attribute (type Date) called DATE OCCURRED (DD-MON-YY).
    Went back to REPORTS source previously defined and added a new Table Column Mapping - mapping OBSDATE to the newly defined DATE OCCURRED (DD-MON-YY) search attribute.
    I then modified the Schedule for the REPORTS source Crawler Policy to “Process All Documents”.
    Schedule crawls and indexes entire REPORTS table.
    In SES Advanced Search page, I enter my search keyword, select Specific Source Group as REPORTS, select All Match, and used the pick list to select the DATE OCCURRED (DD-MON-YY) Attribute Name, operator of Greater than equal, and entered the Value 01-JAN-07. Then the second attribute name of DATE_OCCURRED (DD-MON-YY), less than equals, 10-JAN-07.
    Search results gave me 38,000 documents, and the first 25 I looked at had dates NOT within the 01-JAN-07 / 10-JAN-07 range. (e.g. OBSDATE= 24-MAR-07, 22-SEP-), 02-FEB-08, etc.)
    And, none of the results I opened had ANY dates within the SUMMARY CLOB…in case that’s what was being found in the search.
    Can someone help me figure out how to allow my client to search for specific dated records in a db table using a single column for the date? This is a major requirement and they are anxiously awaiting my solution.
    Thanks, in advance….

    raford,
    Thanks very much for your reply. However, from what I've read in the SES Admin Document is that (I think) the date format DD/MM/YYYY pertains only to searches on "file system" sources (e.g. Word, Excel, Powerpoint, PDF, etc.). We have 3 file system sources among our 25 total sources. The remaining 22 sources are all TABLE or DATABASE sources. The DBA here has done a great job getting the data standardized using the typical/default Oracle DATE type format in our TABLE sources (DD-MON-YY). Our tables have anywhere from 1500 rows to 2 million rows.
    I tested your theory that the dates we are entering are being changed to Strings behind the scenes and on the Advanced Page, searched for results using OBSDATE equals 01/02/2007 in an attempt to find data that I know for certain to be in the mapped OBSDATE table column as 01-FEB-07. My result set contained data that had an OBSDATE of 03-MAR-07 and none containing 01-FEB-07.
    Here is the big issue...in order for my client to fulfill his primary mission, one of the top 5 requirements is that he/she be able to find specific table rows that are contain a specific date or range of dates.
    thanks very much!

  • Need help with date range searches for Table Sources in SES

    Hi all,
    I need help, please. I am trying to satisfy a Level 1 client requirement for the ability to search for records in crawled table sources by a date and/or date range. I have performed the following steps, and did not get accurate results from Advanced searching for date. Please help me understand what I am doing wrong, and/or if there is a way to define a date search attribute without creating a LOV for a date column. (My tables have 500,00 rows.)
    I am using SES 10.1.8.3 on Windows 32.
    My Oracle 10g Spatial Table is called REPORTS and this table has the following columns:
    TRACKNUM Varchar2
    TITLE Varchar2
    SUMMARY CLOB
    SYMBOLCODE Varchar2
    Timestamp Date
    OBSDATE Date
    GEOM SDO_GEOMETRY
    I set up the REPORTS table source in SES, using TRACKNUM as the Primary Key (unique and not null), and SUMMARY as the CONTENT Column. In the Table Column Mappings I defined TITLE as String and TITLE.
    Under Global Settings > Search Attributes I defined a new Search Attribute (type Date) called DATE OCCURRED (DD-MON-YY).
    Went back to REPORTS source previously defined and added a new Table Column Mapping - mapping OBSDATE to the newly defined DATE OCCURRED (DD-MON-YY) search attribute.
    I then modified the Schedule for the REPORTS source Crawler Policy to “Process All Documents”.
    Schedule crawls and indexes entire REPORTS table.
    In SES Advanced Search page, I enter my search keyword, select Specific Source Group as REPORTS, select All Match, and used the pick list to select the DATE OCCURRED (DD-MON-YY) Attribute Name, operator of Greater than equal, and entered the Value 01-JAN-07. Then the second attribute name of DATE_OCCURRED (DD-MON-YY), less than equals, 10-JAN-07.
    Search results gave me 38,000 documents, and the first 25 I looked at had dates NOT within the 01-JAN-07 / 10-JAN-07 range. (e.g. OBSDATE= 10-MAR-07, 22-SEP-07, 02-FEB-08, etc.)
    And, none of the results I opened had ANY dates within the SUMMARY CLOB…in case that’s what was being found in the search.
    Can someone help me figure out how to allow my client to search for specific dated records in a db table using a single column for the date? This is a major requirement and they are anxiously awaiting my solution.
    Thanks very much, in advance….

    raford,
    Thanks very much for your reply. However, from what I've read in the SES Admin Document is that (I think) the date format DD/MM/YYYY pertains only to searches on "file system" sources (e.g. Word, Excel, Powerpoint, PDF, etc.). We have 3 file system sources among our 25 total sources. The remaining 22 sources are all TABLE or DATABASE sources. The DBA here has done a great job getting the data standardized using the typical/default Oracle DATE type format in our TABLE sources (DD-MON-YY). Our tables have anywhere from 1500 rows to 2 million rows.
    I tested your theory that the dates we are entering are being changed to Strings behind the scenes and on the Advanced Page, searched for results using OBSDATE equals 01/02/2007 in an attempt to find data that I know for certain to be in the mapped OBSDATE table column as 01-FEB-07. My result set contained data that had an OBSDATE of 03-MAR-07 and none containing 01-FEB-07.
    Here is the big issue...in order for my client to fulfill his primary mission, one of the top 5 requirements is that he/she be able to find specific table rows that are contain a specific date or range of dates.
    thanks very much!

  • Outputting a data point every second

    I want to output a data point every second to an excel sheet. I got it so that it only outputs one accumlated data point. Each data point includes a timestamp, rate, and volume.
    Attached is my VI.
    Solved!
    Go to Solution.
    Attachments:
    PumpDriver Test 4.vi ‏82 KB

    Mike227 wrote:
    Hey Ravens,
    It never worked...the status isn't even updating which leads me to think that I am getting an error and not clearing it?
    If you post the code, we might be able to help you figure it out.  And errors happen for a reason.  Are you actually getting an error?  If so, what is the error?
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Using band zoom to select all data points within the band

    I'm feeling stupid this morning. I'm a new user with 2011, but haven't figured out how to copy a portion of data. I can use view 2D axis system to view my data. Then I use band zoom to get to the portion I need, but for the life of me I can't get it to copy that portion. I have set flags at the beginning and end and such, but the best I get is the beginning point, a single no value point and the end point. I am not getting all the points in between the flags. Am I supposed to somehow flag all points in the zoom view? I have done a search, but can't figure out what I am doing wrong.
    Robert
    Solved!
    Go to Solution.

    Hello Robert,
    This is a pretty easy and straight forward thing to do:
    Put you data into the VIEW window. Then pick the BAND cursor in the toolbar (see below)
    Select the "Set Flags" icon in the VIEW windows with the data and the Band Cursor:
    After you have the data selected with the FLAGS (the data points will be displayed in a thicker line style) click on the "Copy Data Points" icon:
    You will get a full copy of the data in the band, copied to a  new channel in the Data Portal. In the example below I dragged the new data into both windows (not that the red data is still highlited by the flags, this it's a thicker line style).
    That should answer your question, please let me know if you have additional questions,
         Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Customizing distance between data Points on x-Axis

    Hi,
    I want to draw a LineChart.
    I have these Timestamps [84, 1000, 34000, 34699, 439999] who
    are represanting the x-Value of DataPoints along the X-Axis.
    Unfortunately the distance between 2 datapoints along the
    x-Axis is always the same, that means that between the points with
    x-values 84 and 1000 is the same distance along the axis as between
    the points with x-values 34699 and 439999.
    But the distance between points with x-values of 34699 and
    439999 should be much greater than between 84 and 1000.
    How can I customize the distance between data Points on a
    LineChart to solve my Problem?
    I really dont know right now!
    Greeting,
    Z.

    "zidaninho" <[email protected]> wrote in
    message
    news:gls479$nkt$[email protected]..
    > Hi,
    >
    > I want to draw a LineChart.
    > I have these Timestamps [84, 1000, 34000, 34699, 439999]
    who are
    > represanting
    > the x-Value of DataPoints along the X-Axis.
    >
    > Unfortunately the distance between 2 datapoints along
    the x-Axis is always
    > the
    > same, that means that between the points with x-values
    84 and 1000 is the
    > same
    > distance along the axis as between the points with
    x-values 34699 and
    > 439999.
    > But the distance between points with x-values of 34699
    and 439999 should
    > be
    > much greater than between 84 and 1000.
    >
    > How can I customize the distance between data Points on
    a LineChart to
    > solve
    > my Problem?
    >
    > I really dont know right now!
    What happens if you convert the time stamps to Dates and use
    a DateAxis?

  • Interpolated Data-Connecting Data Points

    Does anyone know how to connect data points that are not sequential? For example, if I have a column with 15 cells and data in cells 1, 5, 8, 10, and 15. When I chart that data, I want those points to be connected with a line, rather than plotted as individual points. In Excel, you select interpolated from the main preference menu under charts. I've searched interpolation and have not found anything. I'm wondering if this function is called something different in Numbers?

    The first method I posted works well if you don't need the "blank" categories/rows taking up space on your chart. But if you need to see the "blank" categories/rows, I have a table that I think will do a straight-line interpolation for you. I'm not sure it is error free but, if not, it'll be obvious when you chart it. I'm also not sure it was the simplest way to do it but a lot of the complexity was a result of my making it easy to add new rows to the bottom. I tend to brute force things so if someone has a simpler solution, I hope they post it.
    Copy the table to your spreadsheet. Copy your data to the X and Y columns and your category labels to Column A. If you only have Y data then the X's must be a numeric series (like what's in the table now). Plot your X-Y (or Y-only) data as one series and the interpolated column as another series. Change the interpolated data points to "none" and change the line color if you want to (which I did not do below).
    http://files.me.com/pwb3/zk3o46.numbers.zip

  • Is it possible to link a text box or shape to a specific chart data point

    Is it possible to link a text box or shape to a specific chart data point?
    Thanks for any help.
    saint3x

    It seems you may be trying to make a timeline.  There are timeline tools out there that may be better for your particular task than Numbers.
    Google search"
         http://www.beedocs.com/easytimeline/
         http://www.tiki-toki.com/desktopapp/
    App Store result for a search "timeline - calendar" produce several options
    Numbers has no object like a textbox or line that takes input from a cell of a table.  You can make suggestions to Apple using the menu item "Numbers > Provide Numbers Feedback"

  • Connect data points on scatter graph

    I currently have a scatter graph to represent the cross section of a creek. I want to connect the data points so that it looks like a line graph.
    However, I cannot find an option in the inspector to do this.
    Thanks
    [IMG]http://i812.photobucket.com/albums/zz49/frusciantaya/Screenshot2010-07-31at72002 PM.jpg[/IMG]

    PacoA wrote:
    How to do it (format scatter charts) in numbers '09?
    Open Numbers '09 Users Guide.
    Type 'format scatter charts' (without the quotes) in the search box.
    Click on the most useful looking (and in this case, only) item in the list.
    Regards,
    Barry
    PS: The Numbers '08 forum isn't the right place for a Numbers '09 question.

  • LV7 How to click on an xy chart and identify the data point selected

    I have an xy chart displaying a time chart showing points when faults were identified, and want the user to be able to touch the plot area and for that data point to be identified so that the main display can be switched to the appropriate data.
    I have a solution where I drag the cursor to the required point then use Mouse Up event to read the cursor value, then search the data array for the matching cursor value and get the solution.
    However this is on a touch screen UI and dragging to cursor does not work very well. What I would like is to be able to convert the mouse position (relative to the full screen) and convert this to the position on the plot area that is given by the cursor position.
    I
    f someone could tell me how to get the screen position of the plot area rather than the full bounds of the xy control I think I could do it.

    Yes, I agree it is not very pratical. I would prefer if the true x,y coordinates could be obtained directly in the event structure.
    In addition to the "Coords" terminal, we also need a terminal that provides the coordinates directly in the true plot units. That would definitely be very useful.
    Make sure to suggest it to NI (I have, long ago!).
    LabVIEW Champion . Do more with less code and in less time .

  • SSRS 2008 Column Chart with Calculated Series (moving average) "formula error - there are not enough data points for the period" error

    I have a simple column chart grouping on 1 value on the category axis.  For simplicity's sake, we are plotting $ amounts grouping by Month on the category axis.  I right click on the data series and choose "Add calculated series...".  I choose moving average.  I want to move the average over at least 2 periods.
    When I run the report, I get the error "Formula error - there are not enough data points for the period".  The way the report is, I never have a guaranteed number of categories (there could be one or there could be 5).  When there is 2 or more, the chart renders fine, however, when there is only 1 value, instead of suppressing the moving average line, I get that error and the chart shows nothing.
    I don't think this is entirely acceptable for our end users.  At a minimum, I would think the moving average line would be suppressed instead of hiding the entire chart.  Does anyone know of any workarounds or do I have to enter another ms. connect bug/design consideration.
    Thank you,
    Dan

    I was having the same error while trying to plot a moving average across 7 days. The work around I found was rather simple.
    If you right click your report in the solution explorer and select "View Code" it will give you the underlying XML of the report. Find the entry for the value of your calculated series and enter a formula to dynamically create your periods.
    <ChartFormulaParameter Name="Period">
                      <Value>=IIf(Count(Fields!Calls.Value) >= 7 ,7, (Count(Fields!Calls.Value)))</Value>
    </ChartFormulaParameter>
    What I'm doing here is getting the row count of records returned in the chart. If the returned rows are greater than or equal to 7 (The amount of days I want the average) it will set the points to 7. If not, it will set the number to the amount of returned rows. So far this has worked great. I'm probably going to add more code to handle no records returned although in my case that shouldn't happen but, you never know.
    A side note:
    If you open the calculated series properties in the designer, you will notice the number of periods is set to "0". If you change this it will overwrite your custom formula in the XML.

  • How to get the last data point from a TDM file in LabVIEW?

    Hello,
    I am using LabVIEW to analyze some rather large TDM files, and I need a way to get only the last data point.  So far, the only way I have been able to accomplish this is by reading the entire file.  Is there a property in the TDM file or a function in LabVIEW that will allow me to get the index of the last item in a channel?  
    Thanks!
    Christina

    Do you want to avoid reading whole file and want to be able to reach or get the index of last value of channel? is there any specific reason? I am not sure you could do it without loading the whole file. But the easiest way would be just to use array functions "array size" would give you the index of last element. 
    -Nilesh
    Kudos are (always) welcome for the good post. :-)

  • Plotting of graph with more than 4000 data points in Excel

    Hi All,
    I am fairly new to labview world. I am trying to plot out line graphs of the results from my program into Excel worksheet. I have huge set of data points(10000) stored in each of 10 different worksheets in MS Excel workbook. I am trying to compile results into last sheet as graphical representation of all the various dataset into 10 different graphs.
    My problem is that I am getting error because MS Graph does not allow me to plot more than 4000 rows or datapoints. Is there better and cleaner way of programming this? Or if some one can provide an example of how to handle such case. I'll appreciate any help.
    My goal is to able to plot one set of data 1st then I will be able to run through various worksheets to compile into standalone results.
     ERROR MESSAGE: "Report Generation Toolkit: Graphs you create or edit in Microsoft Graph cannot contain more than 4,000 rows or columns, including row and column headers. "
    Also for example if we run Line Graph example and change the # of data points from 100 to 4000, we get same message.
    Error -41114 occurred at NI_ReportGenerationToolkit.lvlib:Excel_Insert_Chart.vi -> NI_Excel.lvclass:Excel Insert Graph.vi -> Line Graph (Excel).vi
    Thanks,
    Saurabh

    Hi Dennis,
    I am collecting waveform data from oscilloscope using labview in both data & graph format. So my program collects data for a particular operating condition & then saves the data on a worksheet. After it loads new operating condition & goes over same cycle. I have to save all the data points in excel for different use cases, which I am saving in different worksheet for each specific operating condition.
    Since I already have data saved in excel at the end of test, I am trying plot each use case in the same report for study & presentaion after tests are finished. I have not been able to do so. I read the post which you have mentioned, seems like newer excel or labview version have same issue. I am using LV 9.0
    I will try using decimation but if you have any better way of handling this problem, I'll appreciate if you can share that.
    Thanks for your help.

  • Custom Map using latitude and longitude data points

    Hi,
    I am new to Apex and I want to lost custom data points using latitude and longitude data points. I
    have seen posts referring to the chart example (http://apex.oracle.com/pls/apex/f?p=36648:65:2214483882702::NO:::) ; could someone help me with the following:
    1) How to add On Demand Application Process to a map page (step 4 in the demo)
    2) What is a hidden item and how to add it to a page (step 6)
    Any help would be greatly appreciated.
    Kind regards,
    Lisa

    I am trying to do the same thing. I have got the get_data function working to create the desired output. However when I replace the xml <data> block with &P65_DATA, it does not work. If I display P65_DATA on the page, it has correct output. If I cut and paste the output into custom XML, it works fine. Anyone have come across this issue..any ideas how to fix it?

Maybe you are looking for