Loading ...
Sorry, an error occurred while loading the content.

Break processing

Expand Messages
  • Jamie Echlin
    Morning, I have data that I would like to accumulate but reset the counter to zero when another field changes, example: 0 6 5 - Urgent 0 5 4 - Very High 1 3 5
    Message 1 of 4 , May 28, 2006
    • 0 Attachment
      Morning,

      I have data that I would like to accumulate but reset the counter to
      zero when another field changes, example:

      0 6 5 - Urgent
      0 5 4 - Very High
      1 3 5 - Urgent
      1 5 4 - Very High
      2 3 5 - Urgent
      2 18 4 - Very High


      The second column shd accumulate until the first col changes, I thought
      I would want some combination of processdata with breaks and a sub
      processdata with accum, but I can't get breaks to work:

      #loop
      #proc processdata
      action: breaks
      fields: 1
      showresults: yes
      #proc endproc

      #if @NRECORDS = 0
      #break
      #endif

      #endloop

      This just prints out the data from the first set, ie month 0, then
      nothing further.

      // proc processdata results (action = breaks)
      [0][6][5_-_Urgent][5][-][Urgent]
      [0][5][4_-_Very_High][4][-][Very]
      pl proc areadef: error 17: autorange: no data set has been
      read/specified w/ proc getdata
      pl proc areadef: error 17: autorange: no data set has been
      read/specified w/ proc getdata
      ...

      Assuming I get this part working, do I then want to another processdata
      with accum?

      Another small question: is there a way of making gapmissing assume the
      value should be zero? With SQL you're often not going to get rows for
      zero values, to get zero value rows you need to do a cumbersome cross
      join followed by an outer join, painful.

      Cheers, jamie
    • Stephen C. Grubb
      Hi Jamie, it should be: #proc getdata file: yourdatafile #proc areadef xrange: 0 10 yrange: 0 100 #loop #proc processdata action: breaks fields: 1
      Message 2 of 4 , May 29, 2006
      • 0 Attachment
        Hi Jamie, it should be:

        #proc getdata
        file: yourdatafile

        #proc areadef
        xrange: 0 10
        yrange: 0 100

        #loop
        #proc processdata
        action: breaks
        fields: 1
        showresults: yes
        #endproc

        #if @NRECORDS = 0
        #break
        #endif

        // now run an accumulation on the result..
        #proc processdata
        action: accumulate
        fields: 2

        // plot the accumulation
        #proc bars
        locfield: 1
        lenfield: 2

        // get back to the original data set
        // so proc processdata doesn't get confuseded
        #proc usedata
        original: yes

        #endloop


        this is needed because after proc processdata the 'current data set' is
        the processdata result. There was some confusion over this in past
        docs/versions, but the processdata manual page example is correct as it
        stands now http://ploticus.sourceforge.net/doc/processdata.html#breaks


        > Another small question: is there a way of making gapmissing assume the
        > value should be zero? With SQL you're often not going to get rows for
        > zero values, to get zero value rows you need to do a cumbersome cross
        > join followed by an outer join, painful.

        Are you saying that, when you're doing a lineplot, and when there's an
        automatically detected gap, you want the line drop down to zero instead of
        gapping ?


        Steve


        On Sun, 28 May 2006, Jamie Echlin wrote:

        > Morning,
        >
        > I have data that I would like to accumulate but reset the counter to
        > zero when another field changes, example:
        >
        > 0 6 5 - Urgent
        > 0 5 4 - Very High
        > 1 3 5 - Urgent
        > 1 5 4 - Very High
        > 2 3 5 - Urgent
        > 2 18 4 - Very High
        >
        >
        > The second column shd accumulate until the first col changes, I thought
        > I would want some combination of processdata with breaks and a sub
        > processdata with accum, but I can't get breaks to work:
        >
        > #loop
        > #proc processdata
        > action: breaks
        > fields: 1
        > showresults: yes
        > #proc endproc
        >
        > #if @NRECORDS = 0
        > #break
        > #endif
        >
        > #endloop
        >
        > This just prints out the data from the first set, ie month 0, then
        > nothing further.
        >
        > // proc processdata results (action = breaks)
        > [0][6][5_-_Urgent][5][-][Urgent]
        > [0][5][4_-_Very_High][4][-][Very]
        > pl proc areadef: error 17: autorange: no data set has been
        > read/specified w/ proc getdata
        > pl proc areadef: error 17: autorange: no data set has been
        > read/specified w/ proc getdata
        > ...
        >
        > Assuming I get this part working, do I then want to another processdata
        > with accum?
        >
        > Another small question: is there a way of making gapmissing assume the
        > value should be zero? With SQL you're often not going to get rows for
        > zero values, to get zero value rows you need to do a cumbersome cross
        > join followed by an outer join, painful.
        >
        > Cheers, jamie
        >
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >


        Stephen C. Grubb scg@... x-6633
        Scientific Software Engineer, The Jackson Laboratory
        600 Main Street Bar Harbor, Maine 04609 USA
      • Jamie Echlin
        Hi Steve, Thanks for that, will give it a try. ... Yep. I know that probably doesn t make sense when plotting scientific data, but in my case no row from the
        Message 3 of 4 , May 29, 2006
        • 0 Attachment
          Hi Steve,

          Thanks for that, will give it a try.

          > Are you saying that, when you're doing a lineplot, and when there's an
          > automatically detected gap, you want the line drop down to
          > zero instead of
          > gapping ?

          Yep. I know that probably doesn't make sense when plotting scientific
          data, but in my case no row from the db means the value is definitely
          zero, as opposed to failing to collect data or some other corner case
          where a gap is correct. Again, I can work around this but the SQL is a
          lot more complicated, a "gapmissing: zero" would save me a lot of
          heartache.

          > I'm putting this in now. Trying to get 2.33 out in the next couple of
          > days.

          Lovely.

          OK, I am probably pushing my luck now, but do you think you may ever add
          support for collision detection for data labels and axis stub labels and
          so on? I'm sort of wondering if the architecture of ploticus makes this
          doable or unfeasibly hard, not understanding enough C I can't work this
          out for myself.

          And err... radar charts/polar co-ords?

          Regards, jamie


          > -----Original Message-----
          > From: ploticus@yahoogroups.com
          > [mailto:ploticus@yahoogroups.com] On Behalf Of Stephen C. Grubb
          > Sent: 29 May 2006 16:32
          > To: ploticus@yahoogroups.com
          > Subject: Re: [ploticus] Break processing
          >
          >
          > Hi Jamie, it should be:
          >
          > #proc getdata
          > file: yourdatafile
          >
          > #proc areadef
          > xrange: 0 10
          > yrange: 0 100
          >
          > #loop
          > #proc processdata
          > action: breaks
          > fields: 1
          > showresults: yes
          > #endproc
          >
          > #if @NRECORDS = 0
          > #break
          > #endif
          >
          > // now run an accumulation on the result..
          > #proc processdata
          > action: accumulate
          > fields: 2
          >
          > // plot the accumulation
          > #proc bars
          > locfield: 1
          > lenfield: 2
          >
          > // get back to the original data set
          > // so proc processdata doesn't get confuseded
          > #proc usedata
          > original: yes
          >
          > #endloop
          >
          >
          > this is needed because after proc processdata the 'current
          > data set' is
          > the processdata result. There was some confusion over this in past
          > docs/versions, but the processdata manual page example is
          > correct as it
          > stands now http://ploticus.sourceforge.net/doc/processdata.html#breaks
          >
          >
          > > Another small question: is there a way of making gapmissing
          > assume the
          > > value should be zero? With SQL you're often not going to
          > get rows for
          > > zero values, to get zero value rows you need to do a
          > cumbersome cross
          > > join followed by an outer join, painful.
          >
          > Are you saying that, when you're doing a lineplot, and when there's an
          > automatically detected gap, you want the line drop down to
          > zero instead of
          > gapping ?
          >
          >
          > Steve
          >
          >
          > On Sun, 28 May 2006, Jamie Echlin wrote:
          >
          > > Morning,
          > >
          > > I have data that I would like to accumulate but reset the counter to
          > > zero when another field changes, example:
          > >
          > > 0 6 5 - Urgent
          > > 0 5 4 - Very High
          > > 1 3 5 - Urgent
          > > 1 5 4 - Very High
          > > 2 3 5 - Urgent
          > > 2 18 4 - Very High
          > >
          > >
          > > The second column shd accumulate until the first col
          > changes, I thought
          > > I would want some combination of processdata with breaks and a sub
          > > processdata with accum, but I can't get breaks to work:
          > >
          > > #loop
          > > #proc processdata
          > > action: breaks
          > > fields: 1
          > > showresults: yes
          > > #proc endproc
          > >
          > > #if @NRECORDS = 0
          > > #break
          > > #endif
          > >
          > > #endloop
          > >
          > > This just prints out the data from the first set, ie month 0, then
          > > nothing further.
          > >
          > > // proc processdata results (action = breaks)
          > > [0][6][5_-_Urgent][5][-][Urgent]
          > > [0][5][4_-_Very_High][4][-][Very]
          > > pl proc areadef: error 17: autorange: no data set has been
          > > read/specified w/ proc getdata
          > > pl proc areadef: error 17: autorange: no data set has been
          > > read/specified w/ proc getdata
          > > ...
          > >
          > > Assuming I get this part working, do I then want to another
          > processdata
          > > with accum?
          > >
          > > Another small question: is there a way of making gapmissing
          > assume the
          > > value should be zero? With SQL you're often not going to
          > get rows for
          > > zero values, to get zero value rows you need to do a
          > cumbersome cross
          > > join followed by an outer join, painful.
          > >
          > > Cheers, jamie
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          >
          >
          > Stephen C. Grubb scg@... x-6633
          > Scientific Software Engineer, The Jackson Laboratory
          > 600 Main Street Bar Harbor, Maine 04609 USA
          >
          >
          >
          >
          >
          >
          > ------------------------ Yahoo! Groups Sponsor
          > --------------------~-->
          > Get to your groups with one click. Know instantly when new
          > email arrives
          > http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/_iFolB/TM
          > --------------------------------------------------------------
          > ------~->
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
        • Stephen C. Grubb
          ... I ve added gapmissing: autozero for 2.33 ... Your interest in these two areas has been noted. Both of these would likely be involved efforts and are not
          Message 4 of 4 , May 30, 2006
          • 0 Attachment
            On Mon, 29 May 2006, Jamie Echlin wrote:

            > > Are you saying that, when you're doing a lineplot, and when there's an
            > > automatically detected gap, you want the line drop down to
            > > zero instead of
            > > gapping ?
            >
            > Yep. I know that probably doesn't make sense when plotting scientific
            > data, but in my case no row from the db means the value is definitely
            > zero, as opposed to failing to collect data or some other corner case
            > where a gap is correct. Again, I can work around this but the SQL is a
            > lot more complicated, a "gapmissing: zero" would save me a lot of
            > heartache.

            I've added gapmissing: autozero for 2.33

            > OK, I am probably pushing my luck now, but do you think you may ever add
            > support for collision detection for data labels and axis stub labels and
            > so on? I'm sort of wondering if the architecture of ploticus makes this
            > doable or unfeasibly hard, not understanding enough C I can't work this
            > out for myself.
            >
            > And err... radar charts/polar co-ords?

            Your interest in these two areas has been noted.

            Both of these would likely be involved efforts and are not very high
            priority currently. Rudimentary collision detection would probably
            involve keeping a list of labels and graphical elements and checking this
            list before rendering each successive element. The workaround for people
            who need it (such as those publishing in journals) is to render in EPS
            then use Adobe tools to manipulate elements by hand.

            Unfortunately polar/radar can't be implemented just by writing new data
            space to absolute space translating routines.. for one thing assumptions
            about drawing long straight lines in x y space based on two endpoints
            don't hold in polar/radar space (they need to be curved around).


            -Steve
          Your message has been successfully submitted and would be delivered to recipients shortly.