COUNT (Disctinct)

All,
      I am trying to Get COUNT of all DISTINCT (Accounts) in reports, Can any one shed some light on to as how this is done in Bex?

Hi,
Have you seen these 2 documents:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7e58e690-0201-0010-fd85-a2f29a41c7af
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/009819ab-c96e-2910-bbb2-c85f7bdec04a

Similar Messages

  • Performance problem with more than one COUNT(DISTINCT ...) in a query

    Hi,
    (I hope this is the good forum).
    In the following query, I have 2 Count Distinct on 2 different fields of the same table.  Execution time is okay (2 s) with one or the other COUNT(DISCTINCT ...) in the SELECT clause, but is not tolerable (12 s) with both together in the query! I have
    a similar case with 3 counts: 4 s each, 36 s when together!
    I've looked at the execution plan, and it seems that with two count distinct, SQL server sorts the table twice before joining the results.
    I do not have much experience with SQL server optimization, and I don't know what to improve and how. The SQL is generated by Business Objects, I have few possibilities to tune it. The most direct way would be to execute 2 different queries, but I'd like
    to avoid it.
    Any advice?
    SELECT
      DIM_MOIS.DATE_DEBUT_MOIS,
      DIM_MOIS.NUM_ANNEE_MOIS,
      DIM_DEMANDE_SCD.CAT_DEMANDE,
      DIM_APPLICATION.LIB_APPLICATION,
      DIM_DEMANDE_SCD.CAT_DEMANDE ,
      count(distinct FAITS_DEMANDE.NB_DEMANDE_FLUX),
      count(distinct FAITS_DEMANDE.NB_DEMANDE_RESOL_NIV1)
    FROM
      ALIM_SID.DIM_MOIS INNER JOIN ALIM_SID.DIM_JOUR ON (DIM_JOUR.SEQ_MOIS=DIM_MOIS.SEQ_MOIS)
       INNER JOIN ALIM_SID.FAITS_DEMANDE ON (FAITS_DEMANDE.SEQ_JOUR=DIM_JOUR.SEQ_JOUR)
       INNER JOIN ALIM_SID.DIM_APPLICATION ON (FAITS_DEMANDE.SEQ_APPLICATION=DIM_APPLICATION.SEQ_APPLICATION)
       INNER JOIN ALIM_SID.DIM_DEMANDE_SCD ON (FAITS_DEMANDE.SEQ_DEMANDE_SCD=DIM_DEMANDE_SCD.SEQ_DEMANDE_SCD)
    WHERE
      ( ( DIM_MOIS.NUM_ANNEE_MOIS ) >201301
    GROUP BY
      DIM_MOIS.DATE_DEBUT_MOIS,
      DIM_MOIS.NUM_ANNEE_MOIS,
      DIM_DEMANDE_SCD.CAT_DEMANDE,
      DIM_APPLICATION.LIB_APPLICATION

    Here is the script, nothing original. Hope this helps.
    -- Fact table :
    -- foreign keys begin by FK_,
    -- measures to counted (COUNT DISTINCT) begin with NB_
    CREATE TABLE [ALIM_SID].[FAITS_DEMANDE](
        [SEQ_JOUR] [int] NOT NULL,
        [SEQ_DEMANDE] [int] NOT NULL,
        [SEQ_DEMANDE_SCD] [int] NOT NULL,
        [SEQ_APPLICATION] [int] NOT NULL,
        [SEQ_INTERVENANT] [int] NOT NULL,
        [SEQ_SERVICE_RESPONSABLE] [int] NOT NULL,
        [NB_DEMANDE_FLUX] [int] NULL,
        [NB_DEMANDE_STOCK] [int] NULL,
        [NB_DEMANDE_RESOLUE] [int] NULL,
        [NB_DEMANDE_LIVREE] [int] NULL,
        [NB_DEMANDE_MEP] [int] NULL,
        [NB_DEMANDE_RESOL_NIV1] [int] NULL,
     CONSTRAINT [PK_FAITS_DEMANDE] PRIMARY KEY CLUSTERED
        [SEQ_JOUR] ASC,
        [SEQ_DEMANDE] ASC,
        [SEQ_DEMANDE_SCD] ASC,
        [SEQ_APPLICATION] ASC,
        [SEQ_INTERVENANT] ASC,
        [SEQ_SERVICE_RESPONSABLE] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
     CONSTRAINT [AK_AK_FAITS_DEMANDE_FAITS_DE] UNIQUE NONCLUSTERED
        [SEQ_JOUR] ASC,
        [SEQ_DEMANDE] ASC,
        [SEQ_DEMANDE_SCD] ASC,
        [SEQ_APPLICATION] ASC,
        [SEQ_INTERVENANT] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE]  WITH CHECK ADD  CONSTRAINT [FK_FAITS_DEMANDE_DIM_APPLICATION] FOREIGN KEY([SEQ_APPLICATION])
    REFERENCES [ALIM_SID].[DIM_APPLICATION] ([SEQ_APPLICATION])
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE] CHECK CONSTRAINT [FK_FAITS_DEMANDE_DIM_APPLICATION]
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE]  WITH CHECK ADD  CONSTRAINT [FK_FAITS_DEMANDE_DIM_DEMANDE] FOREIGN KEY([SEQ_DEMANDE])
    REFERENCES [ALIM_SID].[DIM_DEMANDE] ([SEQ_DEMANDE])
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE] CHECK CONSTRAINT [FK_FAITS_DEMANDE_DIM_DEMANDE]
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE]  WITH CHECK ADD  CONSTRAINT [FK_FAITS_DEMANDE_DIM_DEMANDE_SCD] FOREIGN KEY([SEQ_DEMANDE_SCD])
    REFERENCES [ALIM_SID].[DIM_DEMANDE_SCD] ([SEQ_DEMANDE_SCD])
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE] CHECK CONSTRAINT [FK_FAITS_DEMANDE_DIM_DEMANDE_SCD]
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE]  WITH CHECK ADD  CONSTRAINT [FK_FAITS_DEMANDE_DIM_INTERVENANT] FOREIGN KEY([SEQ_INTERVENANT])
    REFERENCES [ALIM_SID].[DIM_INTERVENANT] ([SEQ_INTERVENANT])
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE] CHECK CONSTRAINT [FK_FAITS_DEMANDE_DIM_INTERVENANT]
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE]  WITH CHECK ADD  CONSTRAINT [FK_FAITS_DEMANDE_DIM_JOUR] FOREIGN KEY([SEQ_JOUR])
    REFERENCES [ALIM_SID].[DIM_JOUR] ([SEQ_JOUR])
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE] CHECK CONSTRAINT [FK_FAITS_DEMANDE_DIM_JOUR]
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE]  WITH CHECK ADD  CONSTRAINT [FK_FAITS_DEMANDE_DIM_SERVICE_RESPONSABLE] FOREIGN KEY([SEQ_SERVICE_RESPONSABLE])
    REFERENCES [ALIM_SID].[DIM_SERVICE] ([SEQ_SERVICE])
    GO
    ALTER TABLE [ALIM_SID].[FAITS_DEMANDE] CHECK CONSTRAINT [FK_FAITS_DEMANDE_DIM_SERVICE_RESPONSABLE]
    GO
    -- not shown : extended properties
    -- One of the dimension  tables (they all have a primary key named SEQ_)
    CREATE TABLE [ALIM_SID].[DIM_JOUR](
        [SEQ_JOUR] [int] IDENTITY(1,1) NOT NULL,
        [SEQ_ANNEE] [int] NOT NULL,
        [SEQ_MOIS] [int] NOT NULL,
        [DATE_JOUR] [date] NULL,
        [CODE_ANNEE] [varchar](25) NULL,
        [CODE_MOIS] [varchar](25) NULL,
        [CODE_SEMAINE_ISO] [varchar](25) NULL,
        [CODE_JOUR_ANNEE] [varchar](25) NULL,
        [CODE_ANNEE_JOUR] [varchar](25) NULL,
        [LIB_JOUR] [varchar](25) NULL,
        [LIB_JOUR_COURT] [varchar](25) NULL,
        [JOUR_OUVRE] [tinyint] NULL,
        [JOUR_CHOME] [tinyint] NULL,
     CONSTRAINT [PK_DIM_JOUR] PRIMARY KEY CLUSTERED
        [SEQ_JOUR] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    ALTER TABLE [ALIM_SID].[DIM_JOUR]  WITH CHECK ADD  CONSTRAINT [FK_DIM_JOUR_DIM_ANNEE] FOREIGN KEY([SEQ_ANNEE])
    REFERENCES [ALIM_SID].[DIM_ANNEE] ([SEQ_ANNEE])
    GO
    ALTER TABLE [ALIM_SID].[DIM_JOUR] CHECK CONSTRAINT [FK_DIM_JOUR_DIM_ANNEE]
    GO
    ALTER TABLE [ALIM_SID].[DIM_JOUR]  WITH CHECK ADD  CONSTRAINT [FK_DIM_JOUR_DIM_MOIS] FOREIGN KEY([SEQ_MOIS])
    REFERENCES [ALIM_SID].[DIM_MOIS] ([SEQ_MOIS])
    GO
    ALTER TABLE [ALIM_SID].[DIM_JOUR] CHECK CONSTRAINT [FK_DIM_JOUR_DIM_MOIS]
    GO

  • Disctinct count supported in MDX?

    I would like to know whether Distinct count supported in MDX statements.
    I tried below MDX statement. But it just perform Count() function.
    <EXPRESSION>COUNT(DISTINCT([0MATERIAL].[LEVEL01].MEMBERS),ExcludeEmpty)</EXPRESSION>

    Hi,
    If you are creating Custom Objects in an OLAP universe (using XML and MDX) then there is a formula editor with a expression wizard .
    This will tell you which MDX functions you can use against SAP BW / BEX
    For example, here is a list of MDX functions you can use with MS Analysis Services : http://msdn.microsoft.com/en-us/library/ms145970.aspx
    this will be different from those available for BW, mainly due to internal limitations in the MDXInterface
    Regards,
    H

  • Order of delivery schedule line counter at schedule agreements from MRP run

    Currently we are using schedule agreements for our long term external suppliers, but we are facing a problem with the order of new delivery schedule lines created during MRP run.
    Because of master data settings like, lot size, rounding value, plan delivery time and planning time fence to set as firm new requirements, multiple schedule lines are created with no order for schedule line counter.
    Does anyone is aware of a BADI, user exit or customizing control to have this schedule line counter in order?
    Thank you
    Daniel Guillen
    IT
    Skyworks Inc.

    Hi,
    Pls put this query in SD fourms  and get immly help because this is technical fourms.
    Anil

  • Help Counting Vowels and Consonants using a class

    I'm currently working on a class project where I need take a user inputed string and count how many vowels and/or consonants are in the String at the user discretion. I have the main logic program working fine. However, the trouble I'm running into is how to take the string the user inputed and pass that data into the class method for counting.
    Here is the code for the program:
    package vowelsandconsonants;
    import java.util.Scanner;
    public class VowelConsCounter {
        public static void main(String[] args) {
            String input; //User input
            char selection; //Menu selection
            //Create a Scanner object for keyboard input.
            Scanner keyboard = new Scanner(System.in);
            //Get the string to start out with.
            System.out.print("Enter a string: ");
            input = keyboard.nextLine();
            //Create a VowelCons object.
            VowelCons vc = new VowelCons(input);
            do {
                // Display the menu and get the user's selection.
                selection = getMenuSelection();
                // Act on the selection
                switch (Character.toLowerCase(selection)) {
                    case 'a':
                        System.out.println("\nNumber of Vowels: " +
                                vc.getNumVowels());
                        break;
                    case 'b':
                        System.out.println("\nNumber of consonats: " +
                                vc.getNumConsonants());
                        break;
                    case 'c':
                        System.out.println("\nNumber of Vowels: " +
                                vc.getNumVowels());
                        System.out.println("Number of consonants: " +
                                vc.getNumConsonants());
                        break;
                    case 'd':
                        System.out.print("Enter a string: ");
                        input = keyboard.nextLine();
                        vc = new VowelCons(input);
            } while (Character.toLowerCase(selection) != 'e');
         * The getMenuSelection method displays the menu and gets the user's choice.
        public static char getMenuSelection() {
            String input;  //To hold keyboard input
            char selection;  // The user's selection
            //Create a Scanner object for keyboard input.
            Scanner keyboard = new Scanner(System.in);
            //Display the menu.
            System.out.println("a) Count the number of vowels in the string.");
            System.out.println("b) Count the number of consonants in the string.");
            System.out.println("c) Count both the vowels and consonants in the string.");
            System.out.println("d) Enter another string.");
            System.out.println("e) Exit the program.");
            //Get the user's selection
            input = keyboard.nextLine();
            selection = input.charAt(0);
            //Validate the input
            while (Character.toLowerCase(selection) < 'a' ||
                    Character.toLowerCase(selection) > 'e') {
                System.out.print("Only enter a,b,c,d or e:");
                input = keyboard.nextLine();
                selection = input.charAt(0);
            return selection;
    class VowelCons {
        private char[] vowels;
        private char[] consonants;
        private int numVowels = 0;
        private int numCons = 0;
        public VowelCons(String str) {
        public int getNumVowels() {
            return numVowels;
        public int getNumConsonants() {
            return numCons;
        private void countVowelsAndCons() {
            for (int i = 0; i < total; i++) {
                char ch = inputString.charAt(i);
                if ((ch == 'a') || (ch == 'A') || (ch == 'e') || (ch == 'E') || (ch == 'i') || (ch == 'I') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U')) {
                    numVowels++;
                } else if (Character.isLetter(ch)) {
                    numCons++;
    }The UML given to me by my instructor calls for the counting method to be private. Being that I'm not too familiar with Java syntax I did not know if that may cause a problem with passing the user's input into that method.

    Well the only compilers i get are due to the code:
    private void countVowelsAndCons() {
            for (int i = 0; i < total; i++) {
                char ch = inputString.charAt(i);
                if ((ch == 'a') || (ch == 'A') || (ch == 'e') || (ch == 'E') || (ch == 'i') || (ch == 'I') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U')) {
                    numVowels++;
                } else if (Character.isLetter(ch)) {
                    numCons++;
        }However, that is due to the fact that i have no data for those variables to use. I'm pretty much stuck on how to get the string the user inputs into that method shown above so the code can perform the task of counting the vowels and consonants.
    If i comment out the code within that function the program compiles and will allow me to enter the string and use the options but since i can't figure out how to pass the input to the counting method the program returns 0 for everything.

  • How to count number of Characteristics' with the same value?

    Hello, Everybody,
    In InfoCube I have data:
    person ID (characteristic), points (key figure), gendre (characteristic), org.unit (characteristic)
    1313; 10; F;5001
    1313; 10; M;5001
    1313; 12; F;5001
    1313; 6; M;5001
    1515;20;F;5001
    Report,  with data from this InfoCube, should look like this:
    org.unit/number of employees, 6 points, 10 points, 12 points, 20 points
    5001, 1, 2, 1, 1
    Could you give me a suggestion how I can count the number of employees?
    Thanks in advance!
    Best Regards,
    Arunas Stonys

    Arunas,
    you can crate 4 CKF one each for employee points, and in each of the CKY have a data function value =1 if <your condition is satisfied>. This way the CKY will have a value of 1 if point is 6 for the first CKY and similarly for the rest and use exception aggregation based on person ID to count the no. of employees with that particular point in the Org unit. Use org unit in the rows and these 4 CKY in the columns and you should be able to get the report.
    hope this helps.
    Regards,
    Aashish
    Edited by: Aashish Kalra on Jan 6, 2009 12:31 AM

  • After using "consolidate library" to move my media to a NAS the items counts do not match.  How do I find what is different the easiest way??

    I wanted to move my itunes media on my imac to a NAS drive.  I used the advance preferences to change the folder to the folder on the NAS.  I then went to the "organize library" setting to consolidate.
    When I compare the two folders, the music folders are different (807 items in the old to 798 items in the new), mobile applications are different (143 in the old to 153 in the new), Movies are different (321 items in the old, 324 in the new).
    I think I already had the entire folder organized the way itunes wanted it.  I'm not sure why the count would increase or to easily make sure I'm not missing any info.
    Any suggestions?
    Thanks.

    Actually, a little off on the situation as I originally described.
    Compared the old items counts to the new item counts:
    1. The music folder increased in item counts.
    2.  Books is identical.
    3.  Mobile apps decreased by 10 on the new.
    4.  Movies decreased by 3.

  • Increase counter frequency performanc​e

    Hello,
    I want to increase the frequency performance for my period counter. I'm using a USB-6210 board and I have the vi that is attached - period measurement.
    The problem is that I want to measure the period for a 8MHz signal (I know that is a lot, I would be happy even with 4MHz). The source freq for the counter is 80Hz. If the frequency is high, the accuracy is not very critical for me.
    1. I get most of the time the error: "Buffer overwritten". I've seen that I can get rid of it if I decrease the frequency, but I don't want to do that . I think that another solution would be to increase the number of points that are read. I noticed that the maximum buffer size is around 9000 points (I've read it with DAQmxRead Property Node).
    2. Another fact that I've noticed is that in the While loop where I'm doing the Data Reading I should have no other operations or delay. Is this true, or just a coincidence?
    3. There is a strange behavior: if I start the acquisition and I have at the input high frequency, I get the error (Buffer overwritten) almost instant. If I start acquisition at low freq I can increase it even at high freq.
    4. There is another strange behavior: if the input frequency is high the frequency and the measured period increase and decrease togheter. I think that this is caused by alias. Where can I find some more information about the board limits?
     If you can give me some other advice/hints/links/pdfs I would be very thanksful.
    Maybe there are some small mistakes in the VI. I made it only to get a feeling of what I'm doing. I didn't chek it with the hardware.
    Regards,
    Paul
    Attachments:
    example.vi ‏32 KB

    Paul,
    I  have added some comments to your answer.
    Regards,
    Jochen 
    KPanda wrote:
    Jochen,
    thanks for this information. This was what I was looking for some while.
    I still have a question related to this topic: I've read that the maximum size of FIFO is 1024 samples. What does it mean?
    [JK:] The FIFO is the hardware buffer on the board. In general the PCI-bus or the USB should have enough bandwidth to transfer the data as fast as they are acquired by the device, but in fact there are sometimes some latencies that require some local memory on the board. That's what is called FIFO in this context.
    This FIFO is the same with the: Available Samples Pro Channel from Read Property node?
    [JK:]  No. This value refers to the buffer in the PC's memory that is allocated for the acquisition operation.
    I've noticed that when the value for this property is passing 9000 I get the error with Overwritten Buffer. If it is like this why do I reach more than 9000 samples pro channel? Please take a look at the attachement (test1.png - screenshoot with the values / speed_test_x - the VI that I used for this measurement).
    [JK:] The buffer size is not limited to 9000 values. NI-DAQmx allocates memory automatically by default. If you like you can increase the buffer size manually.
    Which is the relation between maximum numbers of sample that can be read with the Counter 1D Read NSamples? In my VI there are N=250 samples. Can I increase it in order to avoid the error? If yes, which should be the maximum limit, 1024 ?
     [JK:] You can increase the number of values to read up to the size of the buffer (not of the FIFO). A reasonable value is up to 50% of the buffer size, but this is not a strict rule. Anything between 10% and 90% could make sense, depending on the timing requirements of your application.
    Paul
    PS: I've hope that I translated the LabView terms in the right way. I have my LabView in german (but I don't know german, so it is a nightmare for me )

  • Jython error while updating a oracle table based on file count

    Hi,
    i have jython procedure for counting counting records in a flat file
    Here is the code(took from odiexperts) modified and am getting errors, somebody take a look and let me know what is the sql exception in this code
    COMMAND on target: Jython
    Command on source : Oracle --and specified the logical schema
    Without connecting to the database using the jdbc connection i can see the output successfully, but i want to update the oracle table with count. any help is greatly appreciated
    ---------------------------------Error-----------------------------
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 45, in ?
    java.sql.SQLException: ORA-00936: missing expression
    ---------------------------------------Code--------------------------------------------------
    import java.sql.Connection
    import java.sql.Statement
    import java.sql.DriverManager
    import java.sql.ResultSet
    import java.sql.ResultSetMetaData
    import os
    import string
    import java.sql as sql
    import java.lang as lang
    import re
    filesrc = open('c:\mm\xyz.csv','r')
    first=filesrc.readline()
    lines = 0
    while first:
    #get the no of lines in the file
    lines += 1
    first=filesrc.readline()
    #print lines
    ## THE ABOVE PART OF THE PROGRAM IS TO COUNT THE NUMBER OF LINES
    ## AND STORE IT INTO THE VARIABLE `LINES `
    def intWithCommas(x):
    if type(x) not in [type(0), type(0L)]:
    raise TypeError("Parameter must be an integer.")
    if x < 0:
    return '-' + intWithCommas(-x)
    result = ''
    while x >= 1000:
    x, r = divmod(x, 1000)
    result = ",%03d%s" % (r, result)
    return "%d%s" % (x, result)
    ## THE ABOVE PROGRAM IS TO DISPLAY THE NUMBERS
    sourceConnection = odiRef.getJDBCConnection("SRC")
    sqlstring = sourceConnection.createStatement()
    sqlstmt="update tab1 set tot_coll_amt = to_number( "#lines ") where load_audit_key=418507"
    sqlstring.executeQuery(sqlstmt)
    sourceConnection.close()
    s0=' \n\nThe Number of Lines in the File are ->> '
    s1=str(intWithCommas(lines))
    s2=' \n\nand the First Line of the File is ->> '
    filesrc.seek(0)
    s3=str(filesrc.readline())
    final=s0 + s1 + s2 + s3
    filesrc.close()
    raise final

    i changed as you adviced ankit
    am getting the following error now
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 37, in ?
    java.sql.SQLException: ORA-00911: invalid character
    here is the modified code
    sourceConnection = odiRef.getJDBCConnection("SRC")
    sqlstring = sourceConnection.createStatement()
    sqlstmt="update tab1 set tot_coll_amt = to_number('#lines') where load_audit_key=418507;"
    result=sqlstring.executeUpdate(sqlstmt)
    sourceConnection.close()
    Any ideas
    Edited by: Sunny on Dec 3, 2010 1:04 PM

  • Read Only Display of Radio group and Text area with counter not working

    Hello,
    I am using Apex 3.2, with 10g for the database
    I have this form, with fields that will set to read only when status = 'closed'
    All of the fields display as read only except for 2. I cannot figure out why this is not working correctly.
    1st field is Issues that is a text area with character counter, with a sql query behind it, that is set to null unless the query is pulling in the data.
    2nd field is Status which is a radio group that will not display as read only when status = 'closed'
    I have other fields on the form with the same format and they change to read only when the status = 'closed', I have even copied the pl/sql expression from one field to these fields and it still doesn't work correctly. I have also tried javascript for an on load event, which works, but once I click on the save button, it disables all of the page items, which works correctly, but I purposely forget to enter information, to make sure the validations are firing correctly, which it does, but the script disables everything, not allowing me to correct the errors. The javascript is firing on the on page load event.
    Any help on this is greatly appreciated.
    Mary

    Dung,
    That API seems to have a bug, it returns true/false/null, so you could use 'return not nvl(htmldb_util.current_user_in_group(p_group_name => 'APP Admin'),false)' to get a false value.
    Unfortunately there's another problem: using the read-only attributes for checkbox or radiogroup item makes them hidden. My suggestion would be to create another item that has disabled="disabled" in the HTML Form Element attribute in the item definition and display that item or the non-disabled item alternately, using conditions based on the current_user_in_group logic.
    Scott

  • How do I get my data counter back on my home page

    How do I get my widget for data counter on my home screen

    Depending on the phone you have, the widget will either be in the widgets section of your app drawer, or you'll long-press an empty space on your home screen and then see the widgets folder at the bottom of the screen.  Once you're in the widgets folder, find the widget, long-press it, and drag it to where you want it on the home screen, then let go.

  • I had to install a new hard drive because my old hard drives boot files became corrupted, and i want to get all of my music files off the old hard drive and regain all my play counts/ratings/playlists

    Greetings everyone
    as the title says, ive had to install a new hard drive  and i want to transfer my old itunes library onto the new drive, maintaining all playlists/play counts/ratings etc, album artwork if possible. The old hard drive is installed as a slave drive and is completely acessible, but due to the boot files being corrupted i cannot use it as the main drive and therefore operate my old itunes. Also, my ipod no longer contains my music library as itunes synced without my permission and wiped it.
    The only thing i have tried is copying all of my old music files from the old drive by selecting 'add folder to library' and then the old drive, then replacing the new itunes library.itl file with the one from my old itunes. This restores all my playlists and playcounts but when i try to play any of the songs it says that the files could not be found, and i dont fancy locating  8500 music files individually!
    Thankyou for taking the time to read my post, any help will be greatly appreciated.

    Ah, my reply was based on the assumption that you had a default installation of iTunes.
    i.e you had all your music in the iTunes media folder inside your iTunes folder.
    If your iTunes folder is so small compared to the amount of music you have, you must have a different arrangement.
    This complicates you situation considerably.
    iTunes can cope with moving around as long as all the music is in the iTunes media folder, not not if it isn't.
    Your first step should be to get iTunes working on the old drive. This will involve editing the xml library file so that the drive letter is correct and then rebuilding the library from the xml file.
    Then you will need to consolidate your library which moves everything into the iTunes media fodler. After that you will be able to use my first suggestion.
    Step 1
    Find the iTunes folder on the old drive and copy the two library files somewhere else so you can find them again. That's iTunes Library.itl and iTunes Library.xml.
    Now open the copy of iTunes Library.xml with WordPad.
    Look for lines starting:
    Location
    These contain the paths to tracks.
    You will need to use a find/replace to change the drive letter so that it is correct.
    Make sure that you include enough in the "find" so that you only change the right thing.
    Maybe /c:/ and replace with /d:/ or whatever.
    After that, tell iTunes to use the library on the old drive with a shift key start.
    Hold down the shift key and start iTunes, keep holding the shift key until you are prompted to choose a library. Navigate to the iTunes folder on the old drive and choose iTunes Library.itl.
    Then use the method in the following article to rebuild your library;
    http://support.apple.com/kb/HT1451
    Unfortunately the date added will be today for all tracks.
    If iTunes works correctly after this, consolidate your library
    File>>Library>>Organize>>consolidate
    This copies all tracks into to iTunes media folder and could create a problem if you do not have disk space so don't do it if you are unsure about free disk space.
    Check that iTunes works OK and then use the first method.
    Message was edited by: polydorus

  • Counting files in a folder and showing results in an alert window.

    Hello all.
    I would like to get the script to count the number of files in a selected folder.
    I have a UI where there are browse, ok and cancel buttons.
    I wanted the OK button to show the number of jpeg files in the selected folder. If no folder is selected, and the OK button is pressed, it would prompt the user to select a folder before pressing the OK button.
    Thanks!

    all you need to learn scripting is in the "JavaScript Tools Guide", you're making some progress but reading that and following the samples will make things clear and speed the learning proccess up.
    if you look at your code there's only one function, it is called when the Browse button is clicked. See how it is constructed and write another similar function for the Ok button, in there read the contents of the label box and create a folder with that path, then call the function to read the files.
    dlg.Panel1.okBtn.onClick = function (){
       selectedFolder = new Folder(decodeURI(dlg.Panel1.Path.text));
       if (selectedFolder.exists)
            doSomething (selectedFolder);
       else
            alert("select a folder first...");
    dlg.center(); //center dialog box on screen
    dlg.show(); //show dialog box
    function doSomething(folder)
            files = folder.getFiles();
            alert(files.length + " Files in selected Folder");
            alert(files);

  • How do I count specific, smaller groups of information in one large table?

    Hello all,
    I have a feeling the answer to this is right under my nose, but somehow, it is evading me.
    I would like to be able to count how many photos are in any specific gallery. Why? Well, on my TOC page, I thought it would be cool to show  the user how many photos were in any given gallery displayed on the screen as part of all the gallery data I'm presenting. It's not necessary, but I believe it adds a nice touch. My  thought was to have one massive table containing all the photo information and another massive table containing the gallery  information, and currently I do. I can pull various gallery information  based on user selections, but accurately counting the correct number of  images per gallery is evading me.
    In my DB, I have the table, 'galleries', which has several columns, but the two most relevant are g_id and g_spe. g_id is the primary key and is an AI column that represents also the gallery 'serial' number. g_spec is a value that will have one of 11 different values in it (not relevant for this topic.)
    Additionally, there is the table, 'photos', and in this table are three columns:  p_id, g_id and p_fname. p_id is the primary key, g_id is the foreign key (primary key of the 'galleries' table) and p_fname contains the filename of each photo in my ever-expanding gallery.
    Here's the abbreviated contents of the galleries table showing only the first 2 columns:
    (`g_id`, `g_spec`, etc...)
    (1, 11, etc...),
    (2, 11, etc...),
    (3, 11, etc...),
    (4, 11, etc...),
    (5, 12, etc...),
    (6, 13, etc...)
    Here's the contents of my photos table so far, populated with test images:
    (`p_id`, `g_id`, `p_fname`)
    (1, 1, '1_DSC1155.jpg'),
    (2, 1, '1_DSC1199.jpg'),
    (3, 1, '1_DSC1243.jpg'),
    (4, 1, '1_DSC1332.jpg'),
    (5, 1, '1_DSC1381.jpg'),
    (6, 1, '1_DSC1421.jpg'),
    (7, 1, '1_DSC2097.jpg'),
    (8, 1, '1_DSC2158a.jpg'),
    (9, 1, '1_DSC2204a.jpg'),
    (10, 1, '1_DSC2416.jpg'),
    (11, 1, '1_DSC2639.jpg'),
    (12, 1, '1_DSC3768.jpg'),
    (13, 1, '1_DSC3809.jpg'),
    (14, 1, '1_DSC4226.jpg'),
    (15, 1, '1_DSC4257.jpg'),
    (16, 1, '1_DSC4525.jpg'),
    (17, 1, '1_DSC4549.jpg'),
    (18, 2, '2_DSC1155.jpg'),
    (19, 2, '2_DSC1199.jpg'),
    (20, 2, '2_DSC1243.jpg'),
    (21, 2, '2_DSC1332.jpg'),
    (22, 2, '2_DSC1381.jpg'),
    (23, 2, '2_DSC1421.jpg'),
    (24, 2, '2_DSC2097.jpg'),
    (25, 2, '2_DSC2158a.jpg'),
    (26, 2, '2_DSC2204a.jpg'),
    (27, 2, '2_DSC2416.jpg'),
    (28, 2, '2_DSC2639.jpg'),
    (29, 2, '2_DSC3768.jpg'),
    (30, 2, '2_DSC3809.jpg'),
    (31, 2, '2_DSC4226.jpg'),
    (32, 2, '2_DSC4257.jpg'),
    (33, 2, '2_DSC4525.jpg'),
    (34, 2, '2_DSC4549.jpg'),
    (35, 3, '3_DSC1155.jpg'),
    (36, 3, '3_DSC1199.jpg'),
    (37, 3, '3_DSC1243.jpg'),
    (38, 3, '3_DSC1332.jpg'),
    (39, 3, '3_DSC1381.jpg'),
    (40, 3, '3_DSC1421.jpg'),
    (41, 3, '3_DSC2097.jpg'),
    (42, 3, '3_DSC2158a.jpg'),
    (43, 3, '3_DSC2204a.jpg'),
    (44, 3, '3_DSC2416.jpg'),
    (45, 3, '3_DSC2639.jpg'),
    (46, 3, '3_DSC3768.jpg'),
    (47, 3, '3_DSC3809.jpg'),
    (48, 3, '3_DSC4226.jpg'),
    (49, 3, '3_DSC4257.jpg'),
    (50, 3, '3_DSC4525.jpg'),
    (51, 3, '3_DSC4549.jpg');
    For now, each gallery has 17 images which was just some random number I chose.
    I need to be able to write a query that says, tell me how many photos are in a specific photoset (in the photos table) based on the number in galleries.g_id  and photos.g_id being equal.
    As you see in the photos table, the p_id column is an AI column (call it photo serial numbers), and the g_id column assigns each specific photo to a specific gallery number that is equal to some gallery ID in the galleries.g_id table. SPECIFICALLY, for example I would want to have the query count the number of rows in the photos table whose g_id = 2 when referenced to g_id = 2 in the galleries table.
    I have been messing with different DISTINCT and COUNT methods, but all seem to be limited to working with just one table, and here, I need to reference two tables to acheive my result.
    Would this be better if each gallery had its own table?
    It should be so bloody simple, but it's just not clear.
    Please let me know if I have left out any key information, and thank you all in advance for your kind and generous help.
    Sincerely,
    wordman

    bregent,
    I got it!
    Here's the deal: the query that picks the subset of records:
    $conn = dbConnect('query');
    $sql = "SELECT *
            FROM galleries
            WHERE g_spec = '$spec%'
            ORDER BY g_id DESC
            LIMIT $startRow,".SHOWMAX;
    $result = $conn->query($sql) or die(mysqli_error());
    $galSpec = $result->fetch_assoc();
    picks 3 at a time, and with each record is an individual gallery number (g_id). So, I went down into my code where a do...while loop runs through the data, displaying the info for each subset of records and I added another query:
    $conn = dbConnect('query');
    $getTotal = "SELECT COUNT(*)
                FROM photos
                WHERE g_id = {$galSpec['g_id']}
                GROUP BY g_id";
    $total = $conn->query($getTotal);
    $row = $total->fetch_row();
    $totalPix = $row[0];
    which uses the value in $galSpec['g_id']. I didn't know the proper syntax for including it, but when I tried the curly braces, it worked. I altered the number of photos in each gallery in the photos table so that each total is different, and the results display perfectly.
    And as you can see, I used some of the code you suggested in the second query and all is well.
    Again, thank you so much for being patient and lending me your advice and assistance!
    Sincerely,
    wordman

  • Using a counter in addition with variable substitution

    Hi experts,
    i'm having a problem where i can not find a nice 'standard' solution. I'm also not sure if it is possible what i want.
    I'm using a receiver file adapter and sending a .CSV file. The naming convention of this file is: %delivery&-(counter).csv.
    The filling of the delivery is no problem, also the counter is added. But i want the counter to continue counting. Let me explain what happens now.
    Delivery 80000100 is sent by SAP R/3.
    Generated file name: 80000100-0001.csv
    Delivery 80000100 is sent again by SAP R/3 (a change). 
    Generated file name: 80000100-0002.csv
    Delivery 80000101 is sent by SAP R/3.
    Generated file name: 80000101-0001.csv
    In the last situation i do not want the 0001, but i want the 0003. Is this possible ?
    Thanks in advance,
    Peter

    Hello peter,
    We have implement exactly similar scenario.....
    What we did is maintain the counter in a database table field. In the mapping use a dblookup to fetch the last number.. then carry out a function which will carry out dynamic config for filename set.. and then another db call to set the counter incrementing by one...
    The code for setting filename by dynamic config is:
    public String setFilename(String value,Container container){
    //perform lookup
    // Defining AbstractTrace object to write trace messages
    AbstractTrace trace = container.getTrace();
    //Dynamic file name
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    try{
    trace.addInfo("Filename in set name: " + fileName);
    //set file name
    conf.put(key,fileName);
    }catch(Exception e)
         trace.addInfo("Exception: " + e);
    //return value as it is
    return value;

Maybe you are looking for

  • Deleted emails still on my server - where do they go?

    Sorry if this is an old topic; I read a buttload of threads about deleting and still have barely scratched the surface but am too impatient to read any more, and still haven't found my exact issue. When I manually delete an email (which moves it to m

  • SAP LSO - Time Mgmt integration

    Hello Gurus Iu2019m working in a SAP environment where are managed companies in more countries and all companies are using SAP Learning Solution (ECC6.00 EhP4). We are introducing a new country A, in which is managed company X, having 3 personnel sub

  • Photos in Finder, But Missing from iPhoto

    I am able to see all my pictures dating back to 2003 using the finder and directly going to the iPhoto Library. Each folder in the Finder is there as it should be, including the folders for the rolls. However, the images don't show up when I launch i

  • Why is there only one automated audio fader at head and none at tail of some audio clips?

    When I select "Show audio animation," top left of an audio clip, on some sections I have two knobs... one at the head for fade in, and one at the tail for fade out. Why is there only one on some of the audio clips and not both? I've set up the clips

  • Cannot see any data being imputed into biobench.

    Have .5 volts coming into biobench. Do not know what to set any of the voltage or scaling settings to. Just purchased Biobench (version 1.2) and BNC 2090, but know very little about using the system.