Line Chart query...having issues with finding the right SQL...tough query

This initaial entry was much longer and confusing.
I'm looking to make ar running total based using time periods...see the link in the last post to get to the demo.apex.com area.
Rob
Edited by: bostonmacosx on Feb 14, 2013 1:33 PM

bostonmacosx wrote:
Hello there. So I hope I can explain this sufficiently:
OUT OF THE WAY: 11g 4.1.1
I'm going to simplify my data so that it is clear what I'm looking to do.
I want to have a line chart grouped by date. Let's say monthly...this is easy to do if you are dealing with one specific date and some value you can build the series against with case statements. I've done that a million times.
The columns of data I'm dealing with are as follows:
CREATE_DT(create date)
RETIRE_DT(retire date)
MACHINE_TYPE(type of machine)
So lets say I want to see a line chart where each line(data point) is a MACHINE_TYPE and each bin is a month. That month should be any machine with a CREATE_DT below then end of the month and a RETIRE_DT which is either Greater then the end of the month or is NULL(ala hasn't been retired yet).
In the query for a chart which is
SELECT LINK,LABEL,CASE()"",CASE()"",CASE()"" from TABLE GROUP BY ROLLUP(VALUE)I guess I'm not seeing how to be able to put these values together so that it walks month by month and figures out the values and puts them in the correct "bin" of time along the X axis of the chart.
I hope I'm being semi clear as it is hard to explain this scenario. Nope. Clear as mud.
If time is plotted against the X axis, what measure is plotted on the Y?
=============
on another note I built this table from the data:
01-JAN-12     01-FEB-12     01-MAR-12     01-APR-12     01-MAY-12     01-JUN-12     01-JUL-12     01-AUG-12     01-SEP-12     01-OCT-12     01-NOV-12     01-DEC-12     01-JAN-13     ENVOS
59     59     59     59     59     59     59     59     59     59     59     60     60      Alias
12     26     26     26     26     26     26     26     26     26     26     26     26      Blade
9     9     9     9     9     9     9     9     9     9     9     9     9      DataMvrUsing the function:
create or replace FUNCTION ACTIVE_SYSTEMS
RETURN VARCHAR2
is
var1 VARCHAR2(4000):= '';
start_date DATE:= to_Date('05-JAN-2012','DD-MON-YYYY');
end_date DATE:= to_Date('08-JAN-2013','DD-MON-YYYY');
new_start_date DATE;
BEGIN
new_start_date:=trunc(start_date,'MONTH');
var1 := q'!SELECT !';
while(new_start_date<end_date)
LOOP
var1 := var1 || q'! count(case when create_dt<'!'||to_char(new_start_date,'DD-MON-YY')||q'!' and (retire_dt IS NULL or retire_dt>'!'||to_char(new_start_date,'DD-MON-YY')||q'!') then 1 end) "!' ||to_char(new_start_date,'DD-MON-YY')||q'!",!';
new_start_date:= add_months(new_start_date,1);
END LOOP;
var1 := var1 || q'! CMS_NODE_OS.OS_TYPE||' '||node_env as envos from CMS.CMS_NODE LEFT join CMS.CMS_NODE_OS on CMS.CMS_NODE.NODE_NAME=CMS.CMS_NODE_OS.NODE_NAME where retire_dt is NULL group by rollup(CMS_NODE_OS.OS_TYPE||' '||node_env)!';
RETURN var1;
END;
Instead of inadequate attempts to explain this here with fragments of code that we can't do anything with because we don't possess the objects and data they're based on, show us something. Create the objects and some sample data in a workspace on apex.oracle.com and post guest developer credentials. Sketch the required chart or mock it up in a spreadsheet and upload it as an image or PDF so we can see what you're aiming for.

Similar Messages

  • I am having issues with adjusting the duration of time for each still frame and transition in imovie 11.  Each time that I adjust these times, the app does not accept the change, and automatically enters its own time. Am I doing something wrong?

    I am having issues with adjusting the duration of time for each still frame and transition in imovie 11.  Each time that I adjust these times, the application does not accept the change, and instead automatically enters its own time. Is there a work around this? Or am I doing something wrong? Please Help!
    Thank you,
    lagrl

    Have you tried turning off automatic transitions ? Choose file - project properties and follow the dialogue box to change duration with a slider.  iMovie also doesn't allow a transition to be more than 50% duration of the clip its attached to. In other words if the clip is 4 seconds the transition cannot be more than 2 seconds and remember that relates to the first clip as the following clip (right side) is pulled back to overlay it.
    Does this help.  Perhaps you already know this ?

  • Hi am having issues with getting the list of users from the Active Director

    Hi am having issues with getting the list of users from the Active Directory, can anyone help me with this!

    Hi Jason,
    Try this:
    1.  In Ultiboard select Tools>>Netlist Editor>>Pins, press the Delete button
    2.  Select all nets in the Select the Net to Delete dialog and then press the Delete button.  This will clear all nets in the layout, don't worry all traces, parts are still on the design.
    3.  Go to Multisim and select Transfer>>Forward annotate to Ultiboard.    This will add all nets that you removed back and it should fix the pin problem
    Tien P.
    National Instruments

  • Having issues with Mac the ripper and DVD2OneX2

    Is anyone having issues with these two programs, i try to rip my home collection of dvds ( not bought movies) with these programs and they both crash on me.

    both of these apps work fine for me.

  • How to resolve the issue with Finder: "The last time you opened finder, it unexpectedly quit when reopening Windows"

    For anyone who is struggling with this issue that simply will not go away, please try:
    1. Fist turn off the mac
    2. Turn on the mac while holding the shift key (safe mode)
    3. Once all logged in click on Finder at the bottom of your screen
    4. Click on Go 5 steps to the right of the Apple logo
    5. Hold the Alt key and click on Library
    6. Open the Preferences folder
    7. Drag 'com.apple.Finder.plist' to yourDesktop
    7. Restart the mac
    That should hopefully resolve it, if not place the plist file on your Desktop back to its original location. Thank you!

    Do a backup.
    Quit the application.
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Library. Then go to Preferences/com.apple.mail.plist. Move the .plist to your desktop.
    Restart, open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.
    Thanks to leonie for some information contained in this.

  • The issue with using the multiple columns sub-query in WHERE clause

    Hi All,
    my database version is 10.2.
    the problem i am trying to deal with is that when I use multiple column sub-query in the WHERE clause of the SELECT statement, the actual row number returned from the sub-query is different from the whole statement.
    And what I found is that, whenever there is NULL in any of those columns returned from the SUB-QUERY, the outer query will just return NULL for that whole row.
    Here is an example:
    select empno, ename, job, mgr, hiredate, sal, deptno from EMP
    intersect
    select empno, ename, job,  mgr, hiredate, sal, deptno from t;
    7782     CLARK     MANAGER     7839     09-JUN-81     2450     10
    7839     KING     PRESIDENT  NULL  17-NOV-81     5000     10
    7934     MILLER     CLERK     7782     23-JAN-82     1300     10
    select * from EMP where (EMPNO, ENAME, job, MGR, HIREDATE, SAL, DEPTNO) in (
    select empno, ename, job, mgr, hiredate, sal, deptno from EMP
    intersect
    select empno, ename, job,  mgr, hiredate, sal, deptno from t);
    7782     CLARK     MANAGER     7839     09-JUN-81     2450          10     
    7934     MILLER     CLERK     7782     23-JAN-82     1300          10     If I specifically deal with the NULL situations for the columns which might return NULL, I can get the result right.
    select * from EMP where (EMPNO, ENAME, job, NVL(MGR,-1), HIREDATE, SAL, DEPTNO) in (
    select empno, ename, job, nvl(mgr,-1), hiredate, sal, deptno from EMP
    intersect
    select empno, ename, job,  nvl(mgr,-1), hiredate, sal, deptno from t);
    7782     CLARK     MANAGER     7839     09-JUN-81     2450          10     
    7839     KING     PRESIDENT  null   17-NOV-81     5000          10     
    7934     MILLER     CLERK     7782     23-JAN-82     1300          10     the problem is that, I feel this is a very lame way of handling it.
    So, I wonder or am asking if there is any better or standard way to do it?
    any help would be highly appreciated.
    Thanks

    Hi,
    As you discovered, INTERSECT treats NULL as a value, but IN does not.
    What you did with NVL is one way to handle the situation. If there was a chance that any of the columns could be NULL, then you might prefer something like this:
    select      *
    from      EMP
    where      ( EMPNO      || '~' ||
           ENAME      || '~' ||
           job           || '~' ||
           MGR           || '~' ||
           TO_CHAR (HIREDATE, 'DD-MON-YYYY HH24:MI:SS')
                    || '~' ||
           SAL           || '~' ||
           DEPTNO
         ) in (
              select  EMPNO      || '~' ||
                     ENAME      || '~' ||
                   job     || '~' ||
                   MGR     || '~' ||
                   TO_CHAR (HIREDATE, 'DD-MON-YYYY HH24:MI:SS')               
                        || '~' ||
                   SAL      || '~' ||
                   DEPTNO
              from     emp
             intersect
              select  EMPNO      || '~' ||
                     ENAME      || '~' ||
                   job     || '~' ||
                   MGR     || '~' ||
                   TO_CHAR (HIREDATE, 'DD-MON-YYYY HH24:MI:SS')               
                        || '~' ||
                   SAL      || '~' ||
                   DEPTNO
              from      t
             );This assumes that you can identify some string (I used '~') that never occurs in the strings in these tables.
    This is implicitly converting the NUMBERs. That's usually not a good thing to do. but explicitly converting them would make this even more tedious.
    You should explicitly convert any DATEs to strings, however. Depending on your default format, and your data, you might get away with implicit conversions even for DATEs, but don't bet on it.
    If you had to do this often, you might consider writing a user-defined function:
    delimited_string (empno, ename, job, mgr, hiredate, sal, deptno) would return a string like
    '7839~KING~PRESIDENT~~17-NOV-1981~5000~10'
    This will make the coding easier, but beware: it will make the execution slower.

  • I cannot access my ebay account. I can still look for stuff but if I try to login in I get an error message saying that the connection was reset. This is the only site I am having issues with. The site works with IE6 but I would rather use Firefox.

    - Was having problems accessing messages on Facebook, seems to be working now
    - Cannot login on ebay.ca or ebay.com
    - Having troubles listing items on ebay (uploading pictures)... this started before the logging in problems
    - Problems only on laptop, other PC in the not having any problems
    - Can log in to ebay using IE on laptop, but I would rather use Firefox

    HouFunGuy wrote:
     One thing I notice is that the _mmServerScripts folder does not show up in my Local Files folder - even after refreshing. (The underscore must hide this folder?)When I change the drop-down from Local View to Testing Server I don't see the _mmServerScripts folder, and all folders are red.
    The underscore at the beginning of the folder name hides it in the Files panel, although you can turn on the option to display hidden files by accessing the panel options menu.
    The folder icons in the Files panel are colour coded: green is for local files, red represents the testing server (or Subversion repository, if defined), and yellow (Windows) or blue (Mac) represents your remote server.
    As Randy says, check the Web URL in your testing server definition. It should be http://localhost/check_php/.

  • Is anyone having issues with installing the 32 bit version of Adobe Presenter?

    I am trying to install the 32 bit version of Presenter on my computer from the downloaded file on the website. I have an authorization code I put in and then when it starts to download it asks to insert the disk when there is not one. Below are the specs for my computer:
    Windows 7, Microsoft Office 2010, PowerPoint version 14.0.7166.5000 (32-bit)
    Any suggestions???
    Thanks,
    Chris

    After downloading, please do not go inside Presenterwin32” folder or the “Presenterwin64” folder .
    Use the setup.exe that is outside these folders. It will automatically detect whether your PowerPoint is 32 or 64 bit and will install the corresponding Presenter.
    Hope this will resolve your issue.
    Thanks
    Alpi Agarwal
    Adobe Presenter Engineering Team

  • Having issues with getting the slide to advance properly after audio is done playing

    Before I describe the problem I will describe what I'm trying to do.
    I have a slide that plays a video.  When the video is finished the user clicks a Continue button, and a short audio clip plays, and then the slide advances to the next screen.  The problem comes when I'm trying to integrate closed captions.  Since CC is only allowed at the slide lever I created an advanced action that is intended to display the audio text and play the audio.  The caption with the audio text displays fine, but one of two things happens with the audio:
    The slide advances before the audio is done playing.
    I add a pause action to the advanced action and the slide does not advance at all.
    Does anyone have any advice on how to control the slide so it will advance once the audio is done?  Thanks in advance for your help.

    The Pause action WILL pause the slide if invoked.  And there is no way to set the duration of the Pause in the Advanced Action.
    I would suggest you add a button to the slide that the user clicks to go to the next slide.  Add the short audio clip that you want the learner to hear to the On Success caption of that button and set the button properties to Pause for Success/Failure captions.  You can add the CC text for the short audio clip into the success caption so that it appears as the audio is playing.  As soon as the audio clip finishes playing the success caption will disappear and the timeline will continue to the next slide.
    No Advanced Actions required for this solution.

  • Having issues with setting the "Active Window"

    Hello List,
    I've got a LV installation that runs three LV created EXE's simultaneously. In the "top level" application, the user enters a product model number (by way of a PS2 barcode scanner) to be tested, and that application looks at our network to see if there is a test recipe for the product. If there is, it hides and moves itself to the bottom and maximizes and moves to the top EXE number two. On EXE number two, the user is supposed to scan the product serial number. But on occasion, EXE number two is not the active window, even though it is the frontmost and maximized, so the scan from the barcode reader doesn't go into the field. (Looking at the Taskbar at the bottom of the screen, the task for the frontmost & maximized EXE is not "depressed")  A simple mouse click anywhere on the window will make it active, but the users don't have a mouse (or keyboard) (I am able to "remote in" from another computer using a product line "PC Anywhere). I have tried using the "mouse_event" from user32.dll in a "Call Library Function Node", but that doesn't seam to work reliably.
    So my first question is, will the "mouse_event" from user32.dll even fire if my computer doesn't have a mouse plugged in?
    And, if not, does anyone have any better ideas?
    Thanks in advance,
    Mike

    wd8ivl wrote:
    So my first question is, will the "mouse_event" from user32.dll even fire if my computer doesn't have a mouse plugged in?
    I'm guessing that it would, because Windows has a cursor even if there's no mouse plugged in, but I haven't tried it.
    As for the second question, you could try what I posted here, although you'll probably want to clean up the code - http://lavag.org/topic/12751-how-do-you-make-your-​application-window-frontmost/?p=76308
    Try to take over the world!

  • Having issues with syncing the ipod to the itunes

    when i load the ipod after rebooting it will say songs on ipod "name" cannot be updated because all of the playlists selected for syncing no longer exists HELP! i just got the ipod nano and i dont want to have to return it. it was an earily christmas present n it also says that the files are being used under another program

    Have a look at this user tip, it should sort out your missing playlist problem: Hudgie - iPod cannot sync because one or more playlists are missing

  • Having issue with installing the newer version of flash player 15

    this system i think is windows vista 32 bit and trying to install the new version but it gives me this error -
    The ordinal 495 could not be located in the dyamic link library urlnon.dll.
    how do you fix this?
    it does it for all browsers too

    Try resetting Internet Explorer using http://go.microsoft.com/?linkid=9646978

  • Have Officejet J4680c and having issues with getting the wireless to work with my pc (HP Pavilion)

    HP Pavilion Elite- have followed steps in quickstart- doesn't recognize it as a device-
    This question was solved.
    View Solution.

    I assume you have a wireless router?  What brand?
    Have you done this from the front of the printer?: Setup > Network > Wireless Setup Wizard
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Having issues with installing the latest version?

    Hello, I recently reinstalled my windows xp and I am trying to install adobe flash player for youtube ect. When I'm in the middle of installing it, this little screen pops up and says: The procedure entry point SetDllDirectoryW could not be located in the dynamic link library KERNEL32.dll. Please help
    Thanks,
    Tiffany

    Use the forum for Flash player.

  • Issues with getting the slide button to work after upgrade to iOS 7.02 and 7.03

    Ever since upgrading to iOS 7.02 and 7.03 having issues with getting the slide button to work to open up iPad 2.  Happened last week and was able to restore it to new and get it to work again and it worked great until one week later (this morning) doing the same thing.  Have tried restoring iPad to new 3 times (via itunes) and still unable to get the slide button to move so can use the iPad.  IPad able to charge, able to restore, able to sync with itunes even able to recover but not able to get past first screen where you have to slide to access iPad.  Any help would be greatly appeciated.  Live about 300 miles from nearest Apple store.

    I am beginning to wonder whether there isn't some weird problem with that Home button.
    Try this: Settings > General > Accessibility > AssistiveTouch = On
    This will place a button on the iPad's screen.
    You can move this button anywhere on the screen.
    This button gives you - amongst many other things - a soft Home button.
    To turn your iPad on, you can use the Sleep/wake button or move a small magnet across the bezel of the iPad where the volume controls are.
    If you use the magnet, then: Settings > General > Lock / Unlock = On
    Now should not need to press the Home button anymore.
    If this method allows you to use your iPad without a hitch, then suspect hardware problems with the Home button.

Maybe you are looking for