Problem in count

Hi All,
I have problem in count .
Example:
I have values in internal table like this:
No of Traller ,   |         No of  Pallets ,   |       Deliveries,  
|--|--
ABC               |                 00987         |         0000302
ABC           |                  00989        |         0000302
In  report out put  I have to display like this, I have to count.
No of Traller ,                                   No of  Pallets ,    Deliveries,  ________________________________________________________
    1  ,                                 2 ,                          1
How can I  count like this,  Can any one suggest me.
Thanks,

See the example code :
REPORT ZTEST3 line-size 400.
Internal table for all data
data : begin of itab occurs 0,
       nt(3) type c,
       np type i,
       nd(10) type c,
       end of itab.
Internal table for number trailers
data : begin of i_nt occurs 0,
       nt(3) type c,
       end of i_nt.
Internal table for number pallet
data : begin of i_np occurs 0,
       np type i,
       end of i_np.
Internal table for number Delivery
data : begin of i_nd occurs 0,
       nd(10) type c,
       end of i_nd.
Variable
data : v_lines1 type i,
       v_lines2 type i,
       v_lines3 type i.
start-of-selection.
clear : v_lines1,
        v_lines2,
        v_lines3,
        itab,
        i_np,
        i_nt,
        i_nd.
refresh : itab,
          i_nd,
          i_np,
          i_nt.
Pass the value to main internal table manually
itab-nt = 'ABC'.
itab-np =  00987.
itab-nd = '0000302'.
append itab.
itab-nt = 'ABC'.
itab-np =  00989.
itab-nd = '0000302'.
append itab.
loop at itab.
i_nt-nt = itab-nt.
append i_nt.
i_np-np = itab-np.
append i_np.
i_nd-nd = itab-nd.
append i_nd.
endloop.
Count ur Number Trailers
DELETE ADJACENT DUPLICATES FROM i_nt.
describe table i_nt lines v_lines1.
Count ur Number pallets
DELETE ADJACENT DUPLICATES FROM i_np.
describe table i_np lines v_lines2.
Count ur Number Delivery
DELETE ADJACENT DUPLICATES FROM i_nd.
describe table i_nd lines v_lines3.
write:/5 'Number of Trailers',30 'Number of pallet',
       55 'Number of delivery'.
write:/5 v_lines1,30 v_lines2,55 v_lines3.
Reward Points if it is helpful
Thanks
Seshu

Similar Messages

  • Problem with Counter in Query

    Hi Experts,
    There is a problem in my query output.
    I have a CKF for sales documents number created with replacement path which gives the correct count of number of Sales documents.
    But the req here is to create two more counters which will be counting the passed and failed count with reference to other KF1 (the value of this KF can be 0 or 1).
    i.e. If the KF1 value is then failed count would be 1 .
           else passed count would be 1.
    I have used the Replcement path variable created for Sales Document count.
    For failed count the CKF formula which I have created is: (Sales Order Count ) * (KF1<>1)
    Which gives the right result but as soon as I remove the drill down , instead of aggrading the total results, failed counter still shows 1 which is incorrect.
    Could any one please help me out.
    Regards,
    BW User

    hello,
    try using exception aggregation as total and reference char as the one which u have reomved from drilldown.
    Regds,
    Shashank

  • Problem in counting ramks

    Hi,
    I'm facing a problem in calculating ranks. First let me explain you the scenario. I've an InfoCube where I stores information regarding calls made to stores by sales rep. They assign rank to each store and it my change call to call.
    In InfoCube we've Customer dimension, containing details of stores, Material dimension containing details of material, Time (Calendar day), Rank is a navigational attribute of customer. For each row entered in InfoCube we assigned a constant of 1 to fact call.
    Actually, a call is a call made to a store on a particular day. e.g. store s1, visited at day d1 is one call. Similarly s1 d1, s1 d2 are two calls.
    Now, in my one of the reports I need to count the no. of stores under each rank but this data should based on the last call made in the store in the selected period.
    I'll try to explain by an example. Let's say in store s1 two call s are made one on 1-June-2006 and other on 24-June-2006. Ranks in both calls are R1 and R2 respectively. Now in report when I do counting it should show one store in R2 and none in R1 as the rank is changed in R2 at the last call.
    Can anyone pls. help me how to do this.
    Regards
    Tarun

    Hello Francisco,
    I'm not sure what example you found online, but one of the best places to find examples is in the Example Finder located in Help>>Find Examples.  I will list a few examples that will get you started with the features you will like to have in your application.
    1) Count Digital Events.vi - this is a simple event counter that will count either rising or falling edges.  If you find that it gives you more counts than you expect (5 when you expect 1), it could be due to the signal you are receiving.  If it is not a clean signal you could count extra edges.  If this is the case (you are getting extra counts), i recommend viewing the signal by reading it on an analog channel or an oscilloscope.
    2)Building Tables.vi - If you want to display your data in a table on your LabVIEW front panel, this will show you how you can format data.  For different data formats search for the Format Into String function and bring up the context help (CTRL+H).
    3)Write To Text File.vi - this is an example for writing tab-delimited text files (you can open them with Microsoft Excel).  This example simulates data, however you can apply the same concept to data acquired with hardware.  To get the time you can use a 'Get Date and Time in Seconds' function from the timing pallette. You can format the time into a string before writing to a file. 
    The datalogging feature you mentioned is meant to track all indicators/controls on your front panel.  It is not specifically designed for writing just your acquired data to a file. 
    Hope this helps,
    Jennifer O.
    Applications Engineer
    National Instruments

  • Receiver determination - Xpath expression problem with count

    I am working with a scenario where I pick up records from a JDBC connection and if the number of records I pick up is less than a certain number I want to call a webservice.  If it is greater than the number I want to write out a file to be processed by a different process on the receiving end.  I have created the receiver determination condition with the following conditions:
    (/p1:MT_HOG_Data/row[count(row) > 3] EX)
    (/p1:MT_HOG_Data/row[count(row) <= 3] EX)
    The integration is always processing the second condition no matter how many records come in.  I have tried with and without the multiline option.  Can anyone help with this?
    I have searched through the forum and checked the following links without any resolution:
    http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/ab/13bf7191e73a4fb3560e767a2525fd/frameset.htm
    /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
    I can't find any examples where a count of records is checked in the expression editor.  Thanks in advance for any help.

    You can not use the EX operator in that case, because that is used only for node existence checks, not for value checks.
    Do you have a row number in your structure ? Then you could write the xpath expression with that counter tag and value
    Example: you want to send to receiver A if count > 3, else to B:
    you set  /rowNumber EQUAL 4 for sender A
    and /rowNumber NOT EQUAL 4 for sender B
    The condition is applied to the whole document. If one of the node/values are true for that condition, then the whole condition is set to true.
    Problem with that is that the second condition also will be true because nodes for that condition will be found
    better would be to have a rowcount tag in the structure. If that is not possible, you can use the "Enhanced Receiver determination" where you can define a mapping which determines the receivers. There you can do anything complicated you want.
    CSY

  • Photoshop CS5 Print Printing problem: print count and print to ICC profile

    Since Adobe still haven't acknowledge the printing issue with CS5, I start this thread to report my own problems.
    Problem 1:
    print copy count is not working. The first print is always one print regardless how many copies you set in the dialog window. The next print will actually print the copies set in the previous print job.
    This is a well documented problem, and until today no fix.  I am not too worried about this problem because I can always print one copy each time to get job done, until the day Adobe acknowledge and fix the problem.
    Problem 2:
    when I let the Photoshop manage color and print to a custome ICC profile (generated by Spyer3Print), Photoshop RANDOMLY decides to print a light colored magenta cast picture.  It's like Photoshop has used the wrong ICC.  Now every time I print a 13x19, I have to pray.  Because this thing is so random, I can't even reproduce the problem consistantly.
    here's the information about my system:
    Windows 7 Ultimate 64Bit (not a fresh system) with 8GB RAM.  Printer drivers installed: Canon Pro9000II, Canon MP600, Epson 1400.
    I experience problem 2 after I installed CS5 with Epson 1400 printer, but not too frequent.  Later on I installed drivers for Epson R1800, Epson R2400, and I mainly print with R2400.    All the printer drivers, software updates are the lastest available.
    I was a software developer. I wrote windows application before. I am pretty sure the problem is with CS5 based on my knowledge.  If I wrote an Windows application that crashs Windows or another party's appliction, I certainly would not blame Microsoft or another party for not writing a bulletproof system. I would try to find a workaround in my own application.  That's just my take. Adobe may have different mind set. They are still pointing finger to MS and Epson.

    I don't condone the problems, but a workaround I've recently read about for the copy count problem is to do the following, in order:
    1.  Set the copy count you want.
    2.  Click the Print Settings... button to enter the printer driver setup dialog.
    3.  [OK] out.
    4.  Print
    This is reported to get the proper copy count into the print driver and make it "stick".  I just tried it and it seems to work.
    Keep in mind you may want to go through this again after printing to get the copy count to default back to 1 for the next print.
    -Noel

  • Problem with Count

    In Essbase, is it possible to perform a counting function ( one that is similar to the COUNT in Oracle ). For example, I want to:1. Get a count of all the interception with Forecast Measure = 1002. Given a group of interceptions, get a count of all the interception with Forecast Measure = 100If we can't do this in Essbase, we may have two other solutions:1. Perform the count by going through all the interceptions on a one-by-one basise, but it is going to be too too slow2. Have all the values of the Forecast Measure to be stored in Oracle as well. Whenever a value in the Forecast Measure change, the Oracle table automatically gets updated. In Oracle I can do COUNT in SQL. However, I don't know what is the most effective way of performing such kind of data synchronization between Essbase and Oracle.Anyone gets an idea?Thanks,Anne

    To count the rows for the filtered data, you need to fo with actual table nly. May be, you need to look at the index on Column_name, however, that would not help you here as you are using % ''val'' %(not sargable). 
    An index on the column would certainly help, assuming that the table has quite a few more columns than this column. Scanning the index is faster than scaning the index, since it's fewer pages to scan.
    Full-text index that was suggested by someone else, can be a great improvement, but that requires that value searched for is a whole word, or at least start of one.
    But overall Queriessqlserver need to explain the problem in more detail, and particular why (s)he is running this query, to get any meaningful suggestions.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Problem using counter to generate gate signal

    Hello,
    Is there a way to have a counter output a logical high for n input pulses and a low for the rest of the time? I am running into problems implementing this simple task due to idle-state behavior of CreatePulseChannelTicks and CreateCountEdgesChannel.
    The output of the counter is used to gate the device that generates the pulses that are being count. As long as the gate is 'low', no pulses are generated. I run in the following problem:
     When I configure a counter with CreateCountEdgesChannel and use ExportSignals.ExportHardwareSignal to export the 'CounterOutputEvent', the initial state of the output is low. However, I need it to be high to start pulse generation.
     When I configure a counter as a one-shot pulse generator, I have to configure an idle state, delay-, high- and low-count. I tried two combinations:
    idle state low, delay 0, in high the pulse count I want, and low-count very high. However, despite the 'delay=0', the initial output state is low. Thus, my device does not start generating pulses.
    ide state high, delay set to the number of pulses I want, and low- and high-count very high. This does generate the desired gate signal. However, when I stop the counter task, the gate is set 'high' and my device again starts generating pulses. This is undesirable.
    Is there a way to set the IdleState when using CreateCountEdgesChannel? Is there a way to have daqmx to ignore the initial delay and immediately start with the counter output in the inverted IdleState?
    Thanks,
    Maarten van Kampen

    Short update:
    I found the method to set the IdleState when using CreateCountEdgesChannel: .ExportSignals.CounterOutputEventIdleState = CounterOutputEventIdleState.High.
    Howerver, now I run into the same problem with CreateCountEdgesChannel as with CreatePulseChannelTicks: when stopping the task, the output of the counter is always set high. And I want it to remain low when stopping the counter.
    Regards,
    Maarten van Kampen

  • Problem with count query

    I am connecting to the excel and running the following query:
    Select Count(*) from [RIF$];
    I is working fine and giving me total count of rows
    Now when i try the following version of count
    Select Count(Distinct Status) from [RIF$];
    where Status is a column name.
    It is giving the following error:
    java.sql.SQLException: [Microsoft][ODBC Excel Driver] Syntax error (missing operator) in query expression 'Count(Distinct Status)'.
    Pls help me
    its as always urgent

    This shouldn't execute in the quiery analyzer too, you don't have a java problem. I am not sure this is the optimal but you can try something like:
    select count(c_id) from (select distinct pcid c_id from contragent) cntr HTH
    Mike

  • Problem when Counting results of a query

    Hi all
    In our application, we use the Toplink Essentials Queryframework API to create queries because of JPA limitations.
    Now I have a problem: I want to count the results of a existing query, i.e. I have a ReportQuery and I want to count the results of it.
    I tried the following:
    ReportQuery query = ...
    ReportQuery countQuery = new ReportQuery(Pivot.class, builder);
    countQuery.addCount(COUNT,
    ExpressionBuilder.from("id", builder.subQuery(query)));
    countQuery.setShouldReturnSingleValue(true);
    return Integer.valueOf(session.executeQuery(countQuery).toString());
    Now it seems that Toplink executes the query but the result is not correct, i.e. the count result is NOT the same as the number of results in the original query.
    The subquery may contain group by's, a where clause and so on...
    Anyone has an idea how to count the number of results of another query in Toplink?
    It should have the same affect as a simple sql "select count(*) from (select ...)" query.
    Regards
    Michael

    Not exactly sure what your doing, what does the original ReportQuery select?
    You probably want to do something like the following:
    originalQuery...
    ReportQuery countQuery = new ReportQuery(Pivot.class, countBuilder);
    countQuery.addCount("id");
    countQuery.setSelectionCriteria(originalQuery.getSelectionCriteria());
    You may need to also call rebuildOn() if you reuse the same selection criteria from a different query.
    i.e.
    countQuery.setSelectionCriteria(originalQuery.getSelectionCriteria().rebuildOn(countBuilder));
    James : http://www.eclipselink.org

  • Problems with counter in renaming interface not maintaining consistency across multiple libraries

    Happy New Year, all.
    We have a problem in Aperture that I was curious if others had, and I'm hoping somebody has figured out a workaround they will share with me. Originally, we used Aperture and it had one huge library for our different types of photography. We had to change away from that setup because if there was a problem it would take ages to troubleshoot a ~500GB library and perform actions like rebuilding the library. We didn't want to do this, but splitting into six libraries has improved the speed in general and has made rebuilding smaller individual libraries quicker.
    We shoot a lot of photos and want each photo to have a unique number (along with a custom name). We set up a rename option in Aperture that has "Custom Name_Counter" and set counter to be six digits. The problem this seemed to create is that the counter in the rename function doesn't produce a unique number consistently across libraries. If I'm in library A, and I rename a batch of files, the counter will go up and remember its last number as long as I stay in Library A. The minute I switch to Library B, the number is at where it was the last time I used Library B. This indicates to me that the preferences travel with the library.
    Does anybody know a way that I can have a global preferences file, rather than a library preferences file? It seems it maybe used to be this way, but one of the version 3 upgrades forced me to delete a preferences file for the Facebook bug a couple of version 3 subversions ago.
    On a different note, another problem with renaming is that it is so slow. Renaming master files for even 100 or so files takes minutes. Does anybody else have this happen? Sometimes it's faster, but I haven't been able to figure out a pattern to this.
    I've submitted feature requests for revamping the renaming interface for Aperture for at least a couple of years. It never seems to improve. iView Media Pro, a program I used six years ago, had a great renaming setup and I wish Aperture
    Maybe it's time to reinstall Aperture. I bought it on disc, so it's not through the App store. Does anybody have experience reinstalling? I would, of course, like to keep keywords and other preferences.

    hallerphoto wrote:
    Machine is a Mac Pro dual quad-core 2.16 GHz.
    I am unaware of a 2.16 GHz Mac Pro tower. Are you referring to a Macbook Pro or to an iMac? Or is it a configuration I am just unaware of?
    My concern is that it seems that you may be making major workflow compromises that might be better dealt with by hardware changes as feasible. E.g. most 2.16 GHz Mac CPUs are about 1/6 as strong as a top Mac Pro today or about 1/4 as strong as today's Macbook Pros, and that has huge implications on Aperture performance.
    Also, graphics processors of the 2.16 GHz era were ridiculously weak compared to modern Macs. Aperture has historically performed best with strong GPUs (e.g. the strongest G5 towers would not run Aperture without a GPU upgrade). If you stay with the existing box a GPU upgrade may (if feasible) be in order.
    You did not mention RAM, which has defining impact on Aperture performance.
    Even if no hardware upgrades are made, it is useful to know what hardware performance bottlenecks may exist. So some questions:
    • Which Mac(s), exactly?
    • Which OS version and which Aperture version?
    • How much RAM is on board?
    • If a Mac Pro, which GPU card is in use?
    • What mass storage (hard drives and SSDs), how connected and how full?
    Thanks.
    -Allen

  • Problem getting Count Of ChildNodes (JAXP)

    I am trying to process an XML Document like
    <Report siteID="1234567">
    <Transaction transactionDetail="VFVF56760482" referenceNumber="32293642" date="09-01-2003 09:30 AM">
    <Item modelNo="" serialNo="" quantity="1" price="250.00" total="250.00" description="Rayban Sun Glasses 1" />
    </Transaction>
    </Report>
    Once i get the Main Node ("Transaction") using
    int nodeLen=0;
    NodeList nList = doc.getElementsByTagName("Transaction");
    nodeLen = nList.getLength();
    for(int i=0; i<nodeLen ;i++){
         Node n = nList.item(i);
         NamedNodeMap nnm = n.getAttributes();
         int attrItems = nnm.getLength();
    //Below is where the problem is..
    System.out.println("ChildNodes:"+ n.getChildNodes().getLength());
    n.getChildNodes.getLength = 3 , there is only one ChildNode for Transaction1 Node.
    Is this a bug in JAXP or am i missing something?
    Appreciate any Help
    Thanks
    Joe Eugene

    n.getChildNodes() includes ignorableWhitespace text
    nodes.
    Refer to
    http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/dom
    2b_display.htmlThanks for your reply...
    Is there a way to get the correct count of ChildNodes?
    Thanks,
    Joe Eugene

  • 6014 board problems with counter 0

    Hi all,
    I'm working on a project with a 6014 board and Real-Time Windows Target of Matlab. I need to interface the signals from two incremental encoders. The qudrature signals are converted into a direction signal and a pulse train signal with the idea to feed them to the counters of the board, configured as bidirectional counters in up/down mode. The connections are as follows:
    For Counter 0 - the pulse train signal is fed to PFI8, and the direction signal to DIO6.
    For Counter 1 - pulse train signal to PFI3, direction signal to DIO7.
    The problem is that Counter 1 is working properly, while with the same signals fed to Counter 0 what I read makes no sense. The counter increments by very large values at once and behaves erraticaly.
    I'm seeing this behavior on two different boards.
    Any help please!
    Thanks in advance!
    Stanislav

    Hi Stanislav,
    My recommendation will be to install Signal express (it is a free application that you can use to generate or aquire data) avaialble at the following location https://lumen.ni.com/nicif/us/evalsignalexpress/content.xhtml
    and DAQmx driver available at the following location http://joule.ni.com/nidu/cds/view/p/id/3423/lang/ro
    After you install the two software mentioned above, launch Signal Express and it should be straight forward how to program because it is a configuration based programming. You can use the menu to generate a train of pulses on counter 1, also you may use an oscilloscope to validate the generation part and than use your software to acquire on CTR0. If you still have the problem to acquire on CTR0, you can reverse it and use Signal Express in the acquisitioin part.
    Best regards,
    I.R.

  • Problems with counter

    Hello everybody.
    I have a problem with a counter used in counter-based maintenance.
    I'm sure that the characteristic was created correctly, so I think the problem is in the mesauring document.
    When I update the counter with a value like the previous(I do that so that scheduling dates will change), the counter resets itself, and at the next updated the the field "Total Counter Reading" is empty.
    Where is the error?
    Thanks advance.
    Viviana

    Hi,
    Though your query is not very clear, what I have understood is that you are creating a mes doc. for which the value already existing is X. You are creating a new meas doc.. with the same value X, your difference should be '0' and the total counter reading should remain as X only. Is it not happening in this way ?
    Regards,
    Bala.

  • Timing problem with counting edges

    Hello!
    I use a NI PCI-6221 DAQ card with NI-DAQmx to count edges of TTL pulses for a spectrometric application.
    It is extremely important that I count the pulses for a well-defined period of time. Typically, I want to count the edges that reach the counter in the period of 400 milliseconds.
    Normally, this works quite well, when I use a WHILE loop that reads and restarts the counter every 400 milliseconds. Things change when the PC I run the VI on has other programs running in the background. Expecially computing-time intensive programs delay the 400 milliseconds of the WHILE loop for up to several 100 percent, resulting in an wrong counter read.
    I tried to use a timed WHILE loop but this din't change anything, regardless of the timimg source (onboard clock or PCI-6221 counter) I applied.
    Has anyone encountered similar problems and found a solution? Isn't there a possibility to control the counting time by hardware?
    Thanks in advance!
    EresthorMessage Edited by Eresthor on 04-07-2005 08:17 AM

    Hej Lynn,
    of course your idea works, thank you. It works extremely well this way, too.
    My problem with this approach is that I need both counters on the PCI-6221 to count data from my spectrometer simultaneously on two channels. That's why I would like to trigger the counter in a different way, for example with a clock.
    Is there no way to trigger the counter with the timebase of a hardware clock on the card? Or ist there another possibility without wasting a counter?
    Eresthor

  • Group by problem with count

    I am trying to figure out the number of charters taken by each customer. I can get it to work fine if I just count the trip id and group by the last name. The problem is that I want to display my customer's full names and keep getting errors when I try to group by the concatenated field Any suggestions? Here is the code I am using:
    Select count(charter.char_trip)"Total Charters",
    CUS_FNAME||' '||CUS_LNAME "Customer"
    From CHARTER, CUSTOMER
    WHERE CUSTOMER.CUS_CODE = CHARTER.CUS_CODE
    Group by "Customer"
    ;

    try using a subquery.
      select cc.customer "Customer",
             count(cc.char_trip) "Total Charters"
        from (select charter.char_trip,
                     CUS_FNAME||' '||CUS_LNAME
                From CHARTER, CUSTOMER
               where CUSTOMER.CUS_CODE = CHARTER.CUS_CODE) cc
      group by cc.customernote: untested

Maybe you are looking for