Cumulative count

Hi,
Is there a way to get the cumulative count of rows ...
table a with 2 fields as follows...
a)
id, stat
a123 1
a342 1
s122 2
s222 2
r334 3
e333 4
I want to get the cumulative sum of rows like below...
select count(*), stat from a group by stat;
the above query gives...
count(*), stat
2 1
2 2
1 3
1 4
I want the result like below...
count, cumulative_count, stat
2 2 1
2 4 2
1 5 3
1 6 4
if I use the query belw I am getting error..
group function nested too deeply!!! 00935
select count(*), stat,
to_char(sum(sum(count(*))) over (partition by stat order by stat
rows unbounded preceding), '99999999999') as cumul_sum
from a
group by stat
order by stat
Thanks,
NPR

Here is a way you could do it.
select stat,count, sum(count) over (order by stat range unbounded preceding) cum_count
from
(select count(*) count, stat from a group by stat);

Similar Messages

  • A kind of cumulative count

    Hello,
    I'm struggling to get a kind of cumulative count over a table, but I can't make it without a view.. But maybe there is a better way to do it.
    So, the table is:
    ID     CAT_ID     NAME     FLAG
    1     2     AAA          null
    2     2     BBB          A
    3     2     CCC          A
    4     2     DDD          null
    5     4     AAA          null
    6     2     EEE          B
    7     2     FFF          A
    And I need to count the 'A' flag for CAT_ID = 2, the result should be like:
    ID     CAT_ID     NAME     FLAG     COUNT
    1     2     AAA          null          0
    2     2     BBB          A          1
    3     2     CCC          A          2
    4     2     DDD          null          2
    6     2     EEE          B          2
    7     2     FFF          A          3
    Please advise.
    Thanks!

    with t as (
               select 1 id,2 cat_id,'AAA'name ,null flag from dual union all
               select 2,2,'BBB','A' from dual union all
               select 3,2,'CCC','A' from dual union all
               select 4,2,'DDD',null from dual union all
               select 5,4,'AAA',null from dual union all
               select 6,2,'EEE','B' from dual union all
               select 7,2,'FFF','A' from dual
    select  t.*,
            count(case when flag='A' then 1 end) over(order by id) cnt
      from  t
    where cat_id = 2
    ID
    CAT_ID
    NAME
    FLAG
    CNT
    1
    2
    AAA
    0
    2
    2
    BBB
    A
    1
    3
    2
    CCC
    A
    2
    4
    2
    DDD
    2
    6
    2
    EEE
    B
    2
    7
    2
    FFF
    A
    3

  • Re: Cumulative Count

    Hi All,
    Tickets Logged per day
    Priority
    27-12
    26-12
    25-12
    24-12
    23-12
    22-12
    21-12
    20-12
    19-12
    P1
    1
    0
    0
    0
    0
    0
    0
    0
    0
    P2
    2
    1
    1
    2
    4
    6
    7
    8
    9
    P3
    4
    1
    4
    3
    2
    1
    4
    5
    0
    P4
    2
    1
    6
    1
    8
    5
    9
    1
    2
    P5
    2
    2
    7
    4
    7
    6
    8
    2
    1
    Tickets opened till date
    Priority
    27-12
    26-12
    25-12
    24-12
    23-12
    22-12
    21-12
    20-12
    19-12
    P1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    Recently I got a requirement to show count of Tickets as of date. i.e. Cumulative count of invoces till date. We have two pivot layouts showing tickets logged per day in the attached layouts(1st) and the second showing cumulative count of tickets opened till date. So for this I tried RSUM(Tickets Count) in the reporting level, but it diddn't work. So i tried in Rpd level also by defining new logical column i.e RSUM(Tickets Count), But still no luck. the second pivot layout is not showing exact cumulative count. Can somebody can help me on figuring out the isse.

    Hi Srini, PFA the Screenshot for your reference. In the first table layout, i have one ticket opened on 27th(i.e. Defects Logged on that day). In the second layout we are capturing tickets count as of today, so here my count should show across all the days as we have zero tickets logged for rest 10 days and count should be in 1.

  • Cumulative Count using SQL

    Hi Guys,
    I have the following sql query:
    select trim(to_char(to_date(substr(assn.creationdate,
                                       0,
                                       instr(assn.creationdate, ':', 1, 3) - 1),
                                'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                        'mm')) || ' - ' ||
           to_char(to_date(substr(assn.creationdate,
                                  0,
                                  instr(assn.creationdate, ':', 1, 3) - 1),
                           'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                   'YYYY') as par_date,
           (case
             when prochis.stateoutreq = 't1Issued' then
              'A-Submit'
             when prochis.stateoutreq = 'LcsRejected' then
              'A-Return'
             when prochis.stateoutreq = 't3RevResp' then
              'A-Return'
             when prochis.stateoutreq = 'CcfReview' then
              'A-Return'
             when prochis.stateoutreq = 't3Validated' then
              'A-Return'
           end) as par_stage,
           count(case
                   when (prochis.processname = 't3_AWD_Awaiting_Cust_Response') then
                    1
                   when (prochis.processname = 't3_AWD_Send_PAR') then
                    1
                   when (prochis.processname = 't3_AWD_Send_PAR_PartB') then
                    1
                   when (prochis.processname = 't3_AWD_Await_PAR_B_Response') then
                    1
                 end) as par_stage_count
      from awdbt1m4.cmchrqit par
      left outer join ttcadminref@TCDWHS aref
        on par.lifecyclestate = aref.short
    inner join awdbt1m4.asgsig assn
        on assn.left = par.obid
    inner join awdbt1m4.prochist prochis
        on assn.right = prochis.obid
    where (case
             when prochis.stateoutreq = 't1Issued' then
              'A-Submit'
             when prochis.stateoutreq = 'LcsRejected' then
              'A-Return'
             when prochis.stateoutreq = 't3RevResp' then
              'A-Return'
             when prochis.stateoutreq = 'CcfReview' then
              'A-Return'
             when prochis.stateoutreq = 't3Validated' then
              'A-Return'
             when prochis.statein = 't3IssPartB' then
              'B-Submit'
             when prochis.stateoutreq = 't3RevPartB' then
              'B-Return'
             when prochis.stateoutreq = 't1FinRev' then
              'B-Return'
           end) is not null
       and prochis.stateoutreq in
           ('t1Issued', 'LcsRejected', 't3RevResp', 'CcfReview', 't3Validated')
       and prochis.lifecyclename = 'PAR Lifecycle'
    group by trim(to_char(to_date(substr(assn.creationdate,
                                          0,
                                          instr(assn.creationdate, ':', 1, 3) - 1),
                                   'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                           'mm')) || ' - ' ||
              to_char(to_date(substr(assn.creationdate,
                                     0,
                                     instr(assn.creationdate, ':', 1, 3) - 1),
                              'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                      'YYYY'),
              (case
                when prochis.stateoutreq = 't1Issued' then
                 'A-Submit'
                when prochis.stateoutreq = 'LcsRejected' then
                 'A-Return'
                when prochis.stateoutreq = 't3RevResp' then
                 'A-Return'
                when prochis.stateoutreq = 'CcfReview' then
                 'A-Return'
                when prochis.stateoutreq = 't3Validated' then
                 'A-Return'
              end)
    order by par_stageand i would like to do a cumulative sum over the results returned from count(case
                   when (prochis.processname = 't3_AWD_Awaiting_Cust_Response') then
                    1
                   when (prochis.processname = 't3_AWD_Send_PAR') then
                    1
                   when (prochis.processname = 't3_AWD_Send_PAR_PartB') then
                    1
                   when (prochis.processname = 't3_AWD_Await_PAR_B_Response') then
                    1
                 end) as par_stage_count section in the sql query.
    I have tried numerous ways to do it but using count and sum in same query with a group by clause is causing a lot of issues.. Any help is greatly appreciated.
    If i add the following section to the query after the count statement: over (partition by column) i receive - not a group expression error message.
    Thanks,
    Rohan
    Edited by: rbha4 on 3/11/2010 15:45

    Brilliant!
    Thanks William - it works!
    Modifying the query to the following fixes it up! - yes using an inline view.....
    select iv.month,
           iv.par_date,
           iv.par_stage,
           iv.par_stage_count,
           sum(iv.par_stage_count) over(order by iv.par_stage rows between unbounded preceding and current row) as cumulative_par_stage_count
      from (select trim(to_char(to_date(substr(assn.creationdate,
                                               0,
                                               instr(assn.creationdate, ':', 1, 3) - 1),
                                        'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                                'MONTH')) as month,
                   trim(to_char(to_date(substr(assn.creationdate,
                                               0,
                                               instr(assn.creationdate, ':', 1, 3) - 1),
                                        'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                                'mm')) || ' - ' ||
                   to_char(to_date(substr(assn.creationdate,
                                          0,
                                          instr(assn.creationdate, ':', 1, 3) - 1),
                                   'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                           'YYYY') as par_date,
                   (case
                     when prochis.stateoutreq = 't1Issued' then
                      'A-Submit'
                     when prochis.stateoutreq = 'LcsRejected' then
                      'A-Return'
                     when prochis.stateoutreq = 't3RevResp' then
                      'A-Return'
                     when prochis.stateoutreq = 'CcfReview' then
                      'A-Return'
                     when prochis.stateoutreq = 't3Validated' then
                      'A-Return'
                   end) as par_stage,
                   count(case
                           when (prochis.processname = 't3_AWD_Awaiting_Cust_Response') then
                            1
                           when (prochis.processname = 't3_AWD_Send_PAR') then
                            1
                           when (prochis.processname = 't3_AWD_Send_PAR_PartB') then
                            1
                           when (prochis.processname = 't3_AWD_Await_PAR_B_Response') then
                            1
                         end) as par_stage_count
              from awdbt1m4.cmchrqit par
              left outer join ttcadminref@TCDWHS aref
                on par.lifecyclestate = aref.short
             inner join awdbt1m4.asgsig assn
                on assn.left = par.obid
             inner join awdbt1m4.prochist prochis
                on assn.right = prochis.obid
             where (case
                     when prochis.stateoutreq = 't1Issued' then
                      'A-Submit'
                     when prochis.stateoutreq = 'LcsRejected' then
                      'A-Return'
                     when prochis.stateoutreq = 't3RevResp' then
                      'A-Return'
                     when prochis.stateoutreq = 'CcfReview' then
                      'A-Return'
                     when prochis.stateoutreq = 't3Validated' then
                      'A-Return'
                     when prochis.statein = 't3IssPartB' then
                      'B-Submit'
                     when prochis.stateoutreq = 't3RevPartB' then
                      'B-Return'
                     when prochis.stateoutreq = 't1FinRev' then
                      'B-Return'
                   end) is not null
               and prochis.stateoutreq in ('t1Issued',
                                           'LcsRejected',
                                           't3RevResp',
                                           'CcfReview',
                                           't3Validated')
               and prochis.lifecyclename = 'PAR Lifecycle'
             group by trim(to_char(to_date(substr(assn.creationdate,
                                                  0,
                                                  instr(assn.creationdate,
                                                        1,
                                                        3) - 1),
                                           'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                                   'MONTH')),
                      trim(to_char(to_date(substr(assn.creationdate,
                                                  0,
                                                  instr(assn.creationdate,
                                                        1,
                                                        3) - 1),
                                           'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                                   'mm')) || ' - ' ||
                      to_char(to_date(substr(assn.creationdate,
                                             0,
                                             instr(assn.creationdate, ':', 1, 3) - 1),
                                      'YYYY/MM/DD-HH24:MI:SS') + 10 / 24,
                              'YYYY'),
                      (case
                        when prochis.stateoutreq = 't1Issued' then
                         'A-Submit'
                        when prochis.stateoutreq = 'LcsRejected' then
                         'A-Return'
                        when prochis.stateoutreq = 't3RevResp' then
                         'A-Return'
                        when prochis.stateoutreq = 'CcfReview' then
                         'A-Return'
                        when prochis.stateoutreq = 't3Validated' then
                         'A-Return'
                      end)) iv
    order by iv.par_stage;Cheers,
    Rohan

  • Cumulative Counting

    Hi,
    I'm controlling a stepper motor using software timed pulses (effectively) to pitch a probe with respect to a flat surface, varying its proximity.  The voltage gradients (for my configuration) are steeper near this flat surface so I have decided to experiment with using an exponential (growth) distribution of pulses.  Going from one pulse per increment (measuring station) near the surface to something like 30 pulses per increment much further away where the gradients are smaller.
    I've got the control itself working to specification (as in it responds as commanded to the number of pulses sent) but I want to develop an easy way to track the total number of pulses, i.e. after 5 increments of say (1, 2, 3, 4 and then 5 pulses) on the fifth increment I will record 15 cumulative pulses.  Perhaps someone could provide a quick example which demonstrates how to do this.
    Please note this question is not referring to hardware/digital counting and I'm using labview v8.5.
    Thank you.
    LabVIEW 8.5 User.
    Solved!
    Go to Solution.

    Search LabVIEW help  "shift register".
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • How to use cumulative Value in a formula

    Hello Gurus,
    I would like to use the cumulative value in a query as part of a formula calculation. I have created a KF which is assigned a constant value 1. When displaying the KF I am cumulating it so for each row I am getting 1,2,3,4...etc. How can I use this cumulated value in a formula calculation?
    For example, in a column cumulative count is 1,2,3,4...etc .My requirement is ,i want to identify the record with number 36 , to do this i have created a formula with boolean Equal to function comparing with the required number, but the boolean result what am i getting is Zero instead of one(1).
    The reason i found behind the problem is, the cumulative count that we see is dynamically happening during the run time for display ,but the internal value is 1 only.
    Is there any other way to meet this requirement or am i missing anypoint?.
    Thanks.

    Dear Yaseen,
                To get the value in formula cumulative,after you have created the formula for that particular key figure,go to edit and click on tab "calculations".
    In that select overall result as 'count all values not equal to zero' and single result as 'count all values not equal to zero' .
    And mark the cumulative check box underneath.
    I hope you get the desired result and please do me favour .
    Sumit goomber

  • How to use counter using PCI 6259

    Hello, users,
    I have a PCI 6259 board and use Labview 7.1.
    I'd like to repetitively count the photon signals at 10ms integration time. I want cumulative counts in every 1 sec (1000ms) (or 1 min (60000ms)) And I want to save counts into txt.file which is open in excel program.
    I am a beginner to use counter using PCI 6259 board.
    1. Could you explain default NI-DAQmx counter terminals, i.e., CTR 0 SRC, CTR 0 GATE, CTR 0 AUX, and CTR 0 OUT?
    2. How do I use them or how can I connect to count TTL pulse using PCI 6259?
    3. As I mention my purpose above, which example is the first step to start working my purpose?
    4. If you know good example, could you tell me about that?
    5. If anyone has labview example which is similar to my aim, could you give me some tips or your examples?
    Any hint, comment or advice would be appreciated.
    Thank you so much for your response.
    Leek2

    I have never used the PCI 6259 but have used counters many times with labview, the coding should be the same independent of the board.  What you want to do is finite buffered edge counting using a internal clock.  The best way to do this is to look at the examples programs and use the express vi to get started, then you can use this code to customize your program exactly as you need.
    To address your questions:
    1. CTR0 means "counter 0" the name of the physical resource sometimes listed at GPCTR0.  Each counter has 4 connections to the outside world:
    source "src"(for counting input TTL signals),
    gate (for synchronizing to external clocks and edges),
    out (for pulse-train out operations)
    and aux (specialty operations such as up/down counting and encoding)
    2.For event counting with internal clocking you will only use the src this is the input from the signal you wish to count (ie PMT discriminator for photon counting).
    3,4,5. Look at the count edge examples, there isn't one that does exactly what you want but I have done this with a 6602 (it has e counters) where I use one set of counters to set up a finite pulse train in your case 1000Hz with 1000 pulses, and another counter to edge count on an external pulse, with the source of this pulse routed from the out of the other counter.  Then you can start the task and read when 1000 samples are in the buffer (about 1 second later).
    Hope this helps,
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Posting count

    I lost nearly 500 previous postings and my posting count did start at 0 two months ago.
    Is this a problem only of my account, or had all discussion members to restart at 0?
    Thanks!!
    Andreas

    But it did work for years, didn't it? There are thousands of Mac forums able to count the posts. If at Apple Discussions they are not able to show the post count, they should simply omit it!"
    A large number of problems this time around are caused by the fact that Apple has switched forum software from Web Crossing to Jive. The Jive forum software has a slightly different feature set and some of the features common with Web Crossing are implemented differently. While Web Crossing easily allowed posting cumulative post counts, Jive is set up to display online post counts, so the developers either have to construct a work-around or they have to wait for Jive to add the ability to display cumulative counts.
    Custom avatars is another feature that supported by Web Crossing but not by Jive, although Jive has said they expect custom avatars to be added in an upcoming update or upgrade.
    While switching to Jive will be beneficial in the long run, the switch has caused short-term problems, and the developers are working on them. Although the new forum was tested before launch, including some users, there was no way they could test it under full load. When the new forum did go live under full load, there were some serious performance issues and these were the issues that the developers concentrated on.
    Finally, omitting post counts has been suggested in the past (as well as not displaying or even getting rid of levels), even when the cumulative counts were given and I know of forums that have stopped displaying counts, including some that could display the actual totals.

  • How to count TTL pulses during 100ms ?

    I need to count TTL pulses coming out of an instrument (particule
    counter). The pulses appear randomly. I must count how many pulses
    appeared in the last 100ms, and so on, every 100ms. I don't want
    cumulative counts, but the number of events every 100ms.
    I need a hardware clock, so that the counting pace cannot be disturbed
    by Windows making some weird, unrequested, CPU-hungry task.
    I fact, I need to do that for 2 identical instruments of the same kind,
    and I have 2 cards with 2 counters each, total 4 counters. My idea
    would be to use 1 counter as the clock for 2 other counters, but how to
    trigger the counter value read ?
    Thanks.

    Hi,
    In the example I gave you, you need to supply the TTL you want to count the pulse (connected on pin 37) and a TTL "clock"  which is connected to PFI0. The TTL on PFI0 permits a hardware timing (100ms for example) to count the edges that occur on the TTL source.
    If you do not need hardware timing, have a look at the example attached. You only have to connect the TTL source and the VI counts every 100ms (software timed) the edges that occur durind those 100 ms.
    Hope it will help you,
    Regards,
    David D.
    Application Engineer - NI France
    01-02-2006 01:26 PM
    Attachments:
    Compatge des fronts toutes les 100 ms.vi ‏61 KB

  • Counting TTL pulses within specified integration time

    Dear all,
    I have a PCI-6014 board, and I use Labview 7.1 and would like to do the following task with DAQmx7.4:
    Analog source:  analog square wave (or = 1Hz TTL pulses) produced by a function generator
    Signal: photon signals from a photomultiplier (random TTL pulses)
    I would like to count the photon signals at 100ms integration time, repetitively. But I don't want cumulative counts, just the number of photons (TTL pulses)  in every 100ms.  I would also like to make sure that I synchronize the counter with the analog source, i.e. to make sure I get exactly 10 data points in each analog cycle. ( I can't use the computer to start the function generator and it just keeps running., so I want to make sure I start counting on the starting edge of the analog wave.)
    I used to do this with the traditional DAQ and connected the analog source to the "GATE" pin of the counter , so i could count "while gate is high" ( or while gate low, or count on rising edge/ falling edge. ) However I found some problems and I think my counter wasn't counting correctly, and I would like to rewrite the task  with DAQmx anyway.  Ideally I would like to separate the signals that occur in the first 1/2 and the second 1/2 of each analog cycle. But if that is not quite achievable, I can do the separation later when I process the data, provided that I know each 10 data points from the counter correspond to each analog cycle.
    I have read several threads on the discussion board, but I still couldn't configure my applications using those examples.
    Also I wonder if the "Arm Start Trigger" function is not available on my PCI-6014 card ? Because I can not find it in the Start Trigger property node.
    Thank you very much for your reply. Any hint or advice would be greatly appreciated.
    Joyce

    ...(Continued from prev post due to 500-char limit)
    Now, here's a proposal for a method that should be able to work, though it'll require more data and more processing.  One key area to watch out for under DAQmx is the property node for "Duplicate Count Prevention."  The behavior changed between 7.1 and 7.3 (on E and/or M series, but not on TIO-based counters), then the defaults changed in 7.4, and something changed yet again in 7.5
    Bottom line: you can set it to True or False.  One setting will allow you to buffer up 0 values for intervals where there are no Source signals (photon events) within a sampling period (10 Hz hw clock).  The other setting will not record anything in the buffer for those intervals.  Clearly, you need the former setting, so you can always experiment to see how it behaves.  I kinda gave up on trying to interpret it, understand it, or keep up with the differences by DAQmx version and DAQ board.
    Ok, here goes:  I'm going to propose that you actually oversample by about 10x and that you capture the Analog square wave in sync with your photon counts.  Then your post-processing can determine for sure which samples correspond to Analog Square High and which to Low.  You'll also be able to adjust for times when you get 1 too many or one too few samples in a square wave cycle, due to having independent un-sync'ed timebases.
    So on one counter you generate a 100 Hz clock.  The other one is programmed for buffered period measurement using the 100 Hz clock as a SampleClock and the photon pulses as the Source signal (this must be set up using a DAQmx Channel property node I believe).  Remeber to be careful also about the DuplicateCountPrevention property.
    You would further setup an AI task using the same 100 Hz clock as a Sample clock.  Be sure that the 100 Hz clock task is started after starting both the other tasks.  Also, be sure to always read the same # of samples from both tasks to keep the counter period and AI data in sync.
    Voila!  You now generate a data record of # of photon pulses for each 10 msec interval along with the voltage of the analog square wave at the end of that interval.  A bit of post-processing and you're covered.  If you're not required to manipulate data while the acq tasks are running, you can surely afford to bump up the oversampling rate considerably.  The main advantage is to gain resolution on the time of transition of the analog square wave.  For any interval ending with a TTL state change, you won't know where within that interval the transition occurred.
    -Kevin P.

  • Current Open Cursors Count growing and growing

    Current Open Cursors Count appears to be a cumulative count and always growing since instance is started.
    Warning threshold of 1200 occurs quickly and regular warnings appears on OEM.
    (Oracle 10.1.0.4 on RHEL4AS Linux fresh install)
    The value reported on OEM correspond to:
    select name,value from v$sysstat where name like '%cursors current%';
    result: opened cursors current 194209
    Current open cursors are not
    select count(*) from v$open_cursor;
    which returns a more reasonable value: 293
    Any ideas about that ?
    Nicolas

    i have a tar opened on this .. its a bug with the database.
    After finding the query that OEM runs against the db, you
    will find that the stats the db is gathering at the database level are wrong .. they are cumulative. So until they patch the db, the metric in OEM is useless. Remove the warning/critical levels in the manage metric screen.
    NOTE: they dont use v$open_cursors .. that would be to easy :-)

  • BO Webi: How to populate a variable with the set of static values for Graph

    Hi All,
    I have the data: Order number, Order Date, processing time coming from the SAP Bex query in the below format:
    Order No    Order Date    Processing time (Days)
    1                 Jan-2011      4
    2                 Jan-2011      5
    3                 Feb-2011      6
    In BO webi report, I have to report the number of orders which were processed in <1day, <2days, <3days,...<10days in a graphical view. i.e., X-Axis:  <1day, <2days, <3days,...<10days(10 static buckets for the processing days)
    Y-Axis: Number of Orders.
    The graphical output should be like below:
    X-Axis: <1day, <2days, <3days,<4days,<5days,<6days,<7days,<8days,<9days,<10days
    Y-Axis: 0, 0,0,0,1,2,3,3,3,3  (count(Order No)) (Cumulative count)
    I am able to calculate the number of orders individually for each of the 10 buckets. But the problem i am facing is that I am not able to hold the 10 static bucket values in a variable to use it for the x-axis in the Graph, as these 10 static bucket values are not coming from the backend source.
    I would like to know if there is way to populate a variable(to use it for the X-Axis in the graph) with the set of 10 static values.
    Any help would be highly appreciated.
    Thanks,
    Leela

    Hi ,
    I think we can use the variable as X-axis in chart.. but Variable Qulaification should be Dimension.
    can you try this?.
    Using efasion universe
    1) Select month and Sold at (unit price) , then run the query
    2) create the variable V_Month ==If [Month]=1 Then "Month1" Else "Month2"  (Note = Variable Qulaification should be Dimension)
    3) Create the variable V_Sum= sum (Sold at (unit price))
    4) create another variable V_Cumulative_Sum==[V_Sum]+Previous([V_Sum])
    Now add V_Month and V_Cumulative_Sum in table , then convert to chart.. now you can add the variable V_Month as X-axis of the chart.
    Hope this will help:)
    Thanks
    Ponnarasu K

  • Clear indicator during the while loop

    Hello guys,
    I trying an application very easy to show a number of iteration ( or count  by encoder in second time) and show a partial and a total on two indicator.
    I would like to reset the indicator and chart  when i press a clear button, but the only clean is the chart, while the indicator reset to zero rapidly ( with reinitialize to default value) but keep a memory of the iteration riched at the moment.
    What kind of solution you can suggest me? ) I tried to use shift register, case structure but I can't find a solution
    Thanks again for your precious help or suggest..
    here  I posted my VI
    Solved!
    Go to Solution.
    Attachments:
    cumulating count.vi ‏18 KB

    here there is a VI modified
    Thank you Systemcrash, good suggest..
    I tried to implementing your example( and suggest ) with my application  to acquire a counter ( I using an USB 6009 as prototype)  ,but I can't reset the counting.
    My idea is obtain  a partial count  and total count.
    So when I desire press a button reset or Clear and restart to zero on partial counter indicator  while the total must be the number of count acquired.
    Thanks again for your precious help..
    Dave
    here I posted a Vi modified 
    Attachments:
    cumulating count.vi ‏29 KB

  • How to get sql server performance counters using query?

    Hai i want to see my sql server performance counters like, Full Scans/sec,  Buffer
    Cache Hit Ratio,  Database Transactions/sec, User
    Connections, Average Latch Wait Time (ms), Lock
    Waits/sec, Lock Timeouts/sec, Number
    of Deadlocks/sec, Total Server Memory, SQL
    Re-Compilations/sec, User Settable Query. If any one know how to get it by using query means, please help me.
    Thanks in advance

    Hello,
    Below is query created by Jonathan Kehayias for measuring Perfom counters using DMV sys.dm_os_performance_counter.
    You can download book from below link
    https://www.simple-talk.com/books/sql-books/troubleshooting-sql-server-a-guide-for-the-accidental-dba/
    DECLARE @CounterPrefix NVARCHAR(30)
    SET @CounterPrefix = CASE WHEN @@SERVICENAME = 'MSSQLSERVER'
    THEN 'SQLServer:'
    ELSE 'MSSQL$' + @@SERVICENAME + ':'
    END ;
    -- Capture the first counter set
    SELECT CAST(1 AS INT) AS collection_instance ,
    [OBJECT_NAME] ,
    counter_name ,
    instance_name ,
    cntr_value ,
    cntr_type ,
    CURRENT_TIMESTAMP AS collection_time
    INTO #perf_counters_init
    FROM sys.dm_os_performance_counters
    WHERE ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Full Scans/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Index Searches/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Lazy Writes/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Page life expectancy'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'Processes Blocked'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'User Connections'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Waits/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Wait Time (ms)'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Re-Compilations/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Memory Manager'
    AND counter_name = 'Memory Grants Pending'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'Batch Requests/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Compilations/sec'
    -- Wait on Second between data collection
    WAITFOR DELAY '00:00:01'
    -- Capture the second counter set
    SELECT CAST(2 AS INT) AS collection_instance ,
    OBJECT_NAME ,
    counter_name ,
    instance_name ,
    cntr_value ,
    cntr_type ,
    CURRENT_TIMESTAMP AS collection_time
    INTO #perf_counters_second
    FROM sys.dm_os_performance_counters
    WHERE ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Full Scans/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Index Searches/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Lazy Writes/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Page life expectancy'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'Processes Blocked'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'User Connections'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Waits/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Wait Time (ms)'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Re-Compilations/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Memory Manager'
    AND counter_name = 'Memory Grants Pending'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'Batch Requests/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Compilations/sec'
    -- Calculate the cumulative counter values
    SELECT i.OBJECT_NAME ,
    i.counter_name ,
    i.instance_name ,
    CASE WHEN i.cntr_type = 272696576
    THEN s.cntr_value - i.cntr_value
    WHEN i.cntr_type = 65792 THEN s.cntr_value
    END AS cntr_value
    FROM #perf_counters_init AS i
    JOIN #perf_counters_second AS s
    ON i.collection_instance + 1 = s.collection_instance
    AND i.OBJECT_NAME = s.OBJECT_NAME
    AND i.counter_name = s.counter_name
    AND i.instance_name = s.instance_name
    ORDER BY OBJECT_NAME
    -- Cleanup tables
    DROP TABLE #perf_counters_init
    DROP TABLE #perf_counters_second
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • How we can see the abap memory data

    How we can see the abap-memory data
    fine the code below
    import lsind
             report_title
             table_name
             report_field
             change_display
             show_hide
             conversion_exits
             table_description
             form_program
             select_form
             update_form
             line_size
             line_count
             records[]
             fields[]
             header_fields[]
             select_fields[]
             xrep[]
             from memory id 'LZUT5U11'.
    Regards
    santhosh
    mail-id : [email protected]

    Dear Santosh,
    ABAP MEMORY:
    A logical memory model illustrates how the main memory is distributed from the view of executable programs. A distinction is made here between external sessions and internal sessions .
    An external session is usually linked to an R/3 window. You can create an external session by choosing System/Create session, or by entering /o in the command field. An external session is broken down further into internal sessions. Program data is only visible within an internal session. Each external session can include up to 20 internal sessions (stacks).
    Every program you start runs in an internal session.
    All "squares" with rounded "corners" displayed in the status diagram represent a set of data objects in the main memory.
    The data in the main memory is only visible to the program concerned.
    CALL TRANSACTION and SUBMIT AND RETURN open a new internal session that forms a new program context. The internal sessions in an external session form a memory stack. The new session is added to the top of the stack.
    When a program has finished running, the top internal session in the stack is removed, and the calling program resumes processing.
    The same occurs when the system processes a LEAVE PROGRAM statement.
    LEAVE TO TRANSACTION removes all internal sessions from the stack and opens a new one containing the program context of the calling program.
    The ABAP memory is initialized after the program is called. In other words, you cannot transfer any data to a program called with LEAVE TO TRANSACTION via the ABAP memory.
    SUBMIT replaces the internal session of the program performing the call with the internal session of the program that has been called. The new internal session contains the program context of the called program with which it is performed.
    When a function module is called, the following steps are executed:
    A check is made to establish whether your program has called a function module of the same function group previously.
    If this is not the case, the system loads the associated function group to the internal session of the calling program as an additional program group. This initializes its global data.
    If your program used a function module of the same function group before the current call, the function module that you have called up at present can access the global data of the function group. The function group is not reloaded.
    Within the internal session, all of the function modules that you call from the same group access the global data of that group.
    If, in a new internal session, you call a function module from the same function group as in internal session 1, a new set of global data is initialized for the second internal session. This means that the data accessed by function modules called in session 2 may be different from that accessed by the function modules in session 1.
    You can call function modules asynchronously as well as synchronously. To do so, you must extend the function module call using the addition STARTING NEW TASK ''. Here, '' is a symbolic name in the calling program that identifies the external session, in which the called program is executed.
    Function modules that you call using the addition STARTING NEW TASK '' are executed independently of the calling program. The calling program is not interrupted.
    To make function modules available for local asynchronous calls, you must identify them as executable remotely (processing type: Remote-enabled module).
    There are various ways of transferring data between programs that are running in different program contexts (internal sessions). You can use:
    (1) The interface of the called program (standard selection screen, or interface of a
    subroutine, function module, or dialog module)
    (2) ABAP memory
    (3) SAP memory
    (4) Database tables
    (5) Local files on your presentation server.
    For further information about transferring data between an ABAP program and your presentation server, refer to the documentation for the function modules WS_UPLOAD and WS_DOWNLOAD.
    Function modules have an interface, which you can use to pass data between the calling program and the function module itself (there is also a comparable mechanism for ABAP subroutines). If a function module supports RFC, certain restrictions apply to its interface.
    If you are calling an ABAP program that has a standard selection screen, you can pass values to the input fields. There are two options here:
    By using a variant of the standard selection screen in the program call
    By passing actual values for the input fields in the program call
    If you want to call a report program without displaying its selection screen (default setting), but still want to pass values to its input fields, there is a variety of techniques that you can use.
    The WITH addition allows you to assign values to the parameters and select-options fields on the standard selection screen.
    If the selection screen is to be displayed when the program is called, use the addition: VIA SELECTION-SCREEN.
    Use the pattern button in the ABAP Editor to insert a program call via SUBMIT. The structure shows you the names of data objects that you can complete with the standard selection screen.
    For further information on working with variants and further syntax variants for the WITH addition, see the key word documentation in the ABAP Editor for SUBMIT.
    You can use SAP memory and ABAP memory to pass data between different programs.
    The SAP memory is a user-specific memory area for storing field values. It is available in all of the open sessions in a user's terminal session, and is reset when the terminal session ends. You can use its contents as default values for screen fields. All external sessions can access SAP memory. This means that it is only of limited use for passing data between internal sessions.
    The ABAP memory is also user-specific, and is local to each external session. You can use it to pass any ABAP variables (fields, structures, internal tables, complex objects) between the internal sessions of a single external session.
    Each external session has its own ABAP memory. When you end an external session (/i in the command field), the corresponding ABAP memory is released automatically.
    To copy a set of ABAP variables and their current values (data cluster) to the ABAP memory, use the EXPORT TO MEMORY ID statement. The (up to 32 characters) is used to identify the different data clusters.
    If you repeat an EXPORT TO MEMORY ID statement to an existing data cluster, the new data overwrites the old.
    To copy data from ABAP memory to the corresponding fields of an ABAP program, use the IMPORT FROM MEMORY ID statement.
    The fields, structures, internal tables, and complex objects in a data cluster in ABAP memory must be declared identically in both the program from which you exported the data and the program into which you import it.
    To release a data cluster, use the FREE MEMORY ID statement.
    You can import just parts of a data cluster with IMPORT, since the objects are named in the cluster.
    In the SAP memory, you can define memory areas (SET/GET parameters, or parameter IDs), which you can then address by a name of up to 20 characters.
    You can fill these memory areas either using the contents of input/output fields on screens, or using the ABAP statement:
    SET PARAMETER ID '' FIELD .
    The memory area with the name now has the value .
    You can use the contents of a memory area to display a default value in an input field on a screen.
    You can also read the memory areas from the SAP memory using the ABAP statement GET PARAMETER ID FIELD . The field then contains the value from parameter .
    The link between an input/output field and a memory area in SAP memory is inherited from the data element on which the field is based. You can enable the set parameter or get parameter attributes in the input/output field attributes.
    Once you have set the Set parameter attribute for an input/output field, you can fill it with default values from SAP memory. This is particularly useful for transactions that you call from another program without displaying the initial screen. For this purpose, you must activate the Set parameter functionality for the input fields of the first screen of the transaction.
    You can:
    (1) Copy the data that is to be used for the first screen of the transaction to be called to the parameter ID in the SAP memory. To do so, use the statement SET PARAMETER immediately before calling the transaction.
    (2) Start the transaction using CALL TRANSACTION or LEAVE TO
    TRANSACTION . If you do not want to display the initial screen, use the AND
    SKIP FIRST SCREEN addition.
    (3) The system program that starts the transaction fills the input fields that do not already have default values and for which the Get parameter attribute has been set with values from SAP memory.
    The Technical information for the input fields in the transaction you want to call contains the names of the parameter IDs that you need to use.
    Parameter IDs should be entered in table TPARA. This happens automatically if you create them via the Object navigator.
    Programs that you call using the statements SUBMIT , LEAVE TO TRANSACTION , SUBMIT AND RETURN, or CALL TRANSACTION run in their own SAP LUW, and update requests receive their own update key.
    When you use SUBMIT and LEAVE TO TRANSACTION , the SAP LUW of the calling program ends. If no COMMIT WORK statement occurred before the program call, the update requests in the log table remain incomplete and cannot be processed. They can no longer be executed. The same applies to inline changes that you make using PERFORM &#8230; ON COMMIT.
    Data that you have written to the database using inline changes is committed the next time a new screen is displayed.
    If you use SUBMIT AND RETURN or CALL TRANSACTION to insert a program and then return to the calling program, the SAP LUW of the calling program is resumed when the called program ends. The LUW processing of calling and called programs is independent.
    In other words, inline changes are committed the next time a new screen is displayed. Update requests and calls using PERFORM ... ON COMMIT require an independent COMMIT WORK statement in the SAP LUW in which they are running.
    Function modules run in the same SAP LUW as the program that calls them.
    If you call transactions with nested calls, each transaction needs its own COMMIT WORK, since each transaction maps its own SAP LUW.
    The same applies to calling executable programs, which are called using SUBMIT AND RETURN.
    The statement CALL TRANSACTION allows you to
    Shorten the user dialog when calling using CALL TRANSACTION USING .
    Determine the type of update (asynchronous, local, or synchronous) for the transaction called. For this purpose, use the addition CALL TRANSACTION USING UPDATE 'update_mode', where update_mode can have the values a (asynchronous), L (local), or S (synchronous).
    Combining the two options enables you to call several transactions in sequence (logical chain), to reduce their screen sequence, and to postpone processing of the SAP LUW 2 until processing of the SAP LUW 1 has been completed.
    When you call a function module asynchronously using the CALL FUNCTION STARTING NEW TASK ' ' statement, it runs in its own SAP LUW.
    Programs that are executed with a SUBMIT AND RETURN or CALL
    TRANSACTION statement starts their own LUW processing. You can use these to perform nested (complex) LUW processing.
    You can use function modules as modularization units within an SAP LUW.
    Function modules that are called asynchronously are suitable for programs that allow parallel processing of some of their components.
    All techniques are suitable for including programs with purely display functions.
    Note that a function module called with CALL FUNCTION STARTING NEW TASK is executed as a new logon. It, therefore, sees a separate SAP memory area. You can use the interface of the function module for data transfers.
    Example: In your program, you want to call a display transaction that is displayed in a separate window (amodal). To do so, you encapsulate the transaction call in a function module, which you set as to Remote-enabled module. You use the function module interface to accept values that you write to the SAP memory. You then call up the transaction in the function module using CALL TRANSACTION AND SKIP FIRST SCREEN. You call the function module itself asynchronously.
    Type &#8216;E' locks for nested program calls may be requested more than once from the same object. This behavior can be described as follows:
    Lock entries from function modules called synchronously increment the cumulative counter, And are therefore successful.
    Lock entries from programs called with CALL TRANSACTION or SUBMIT
    AND
    RETURN is refused. The object to be locked by the called program is displayed as already Locked by another user.
    Programs that you call using SUBMIT or LEAVE TO TRANSACTION cannot come into conflict with lock entries from the calling program, since the old program ends when the call is made. When a program ends, the system deletes all of the lock entries that it had set.
    Lock requests belonging to the same user from different R/3 windows or logons are treated as lock requests from other users.
    Regards,
    Rajesh.
    Please reward points if found helpful.

Maybe you are looking for

  • [JSF 1.2] prependId only fixes part of the problem

    This is just to comment on the prependId attribute (4.1.4.2). While I think this is a good start, it does not address all of the occasions where faces might alter the id of a component. There is still the problem of <h:dataTable> and <f:subview>. In

  • Year-to-date summarization

    Hi, I have to get the Year-to-date amount on an ALV output for a GL account. Is there any FM to do it?... Currently Iam just getting the output for the period that I put in selection screen. Thank you, SB.

  • Fill a table in a wordtemplate

    Hallo, I need to fill a table in a word template with data from a measurement. I have bookmarked the table in the template (it has 2 columns and 5 rows). The following try failed: Can anybody help me?! Thanks Solved! Go to Solution.

  • External micro does not work

    I tried to plug an external micro to the audio in/optical digital in port at the back of my i Mac to do some voice over recording with Final Cut express. Then I managed to change the settings in the system preferences by selecting the line in instead

  • Insert SQL server: Conversion failed. On A environment, but not on Test.

    We probably found the cause of this problem. Not that long ago we migrated the databases from SQL server 2005 to SQL server 2012. All databases are migrated now, but only the acceptance one is giving us trouble. After an extensive search we found tha