Count Columns in a row and Logic Relates

I need some help in oracle SQL,
Student(unique) has five races in a table
I need a select statement with student_id - 1 column
I need to count the number columns with values 'Yes' in them
the columns are race1,race2,race3,race4,race5 for a single row --- this should be 2 ndcolumn
The 3rd column should contain the max of the race having 'yes' in them
i.e if race1 and race 3 have values'yes' in them i need 3 in the next column, - 3rd column
Can some one help me in this

Hi,
As pointed out by John, the datamodel is wrong and keeping it as separate table with (student_id, race_id) will be ideal. But, if you still want to use your existing data model, you can use something like
WITH students AS (SELECT 1 student_id,
                         'Yes' race1,
                         'No' race2,
                         'Yes' race3,
                         'No' race4,
                         'Yes' race5
                    FROM DUAL
                  UNION ALL
                  SELECT 2 student_id,
                         'Yes' race1,
                         'No' race2,
                         'Yes' race3,
                         'Yes' race4,
                         'No' race5
                    FROM DUAL)
SELECT student_id,
       DECODE (race1, 'Yes', 1, 0)
    + DECODE (race2, 'Yes', 1, 0)
    + DECODE (race3, 'Yes', 1, 0)
    + DECODE (race4, 'Yes', 1, 0)
    + DECODE (race5, 'Yes', 1, 0) count_race,
       CASE
         WHEN race5 = 'Yes' THEN 5
         WHEN race4 = 'Yes' THEN 4
         WHEN race3 = 'Yes' THEN 3
         WHEN race2 = 'Yes' THEN 2
         WHEN race1 = 'Yes' THEN 1
         ELSE 0
       END max_race
  FROM studentsThanks,
sukhijank

Similar Messages

  • Programmactic Access DataGrid Rows and Columns

    Hello,
    I am new to ActionScript. Can you tell me how can I access
    the rows and columns of a data grid?
    What I want to do is that when the application load, I will
    populate the datagrid with the Xml returned from the webservice.
    After that, webservice will be called periodically (using timer)
    and the information in the datagrid needs to be updated. The cells
    which are updated need to be highlighted.
    The datagrid actually contains the stock market data (symbol
    name and its other attributes). So once the datagrid has been
    populated on application creation, it contains all the symbols in
    the market. After that, only attributes of the symbols will change,
    like price, volume etc. What I want is that once the datagrid is
    populated, i can access the row by using the value of symbol code
    and then update the appropriate columns of that symbol. (Xml from
    next time will contain only symbols whose values change from last
    time).
    Below is the code that I have written so far.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="OnAppCreationComplete()" width="100%"
    height="100%">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    private var count:uint = 0;
    private var messageFramXmlList:XMLList;
    private var marketSnapshotTimer:Timer = new Timer(1000);
    private function OnAppCreationComplete() : void
    this.ajaxServiceInvokerProxy.addEventListener(ResultEvent.RESULT,
    this.OnWebServiceResultArrived);
    this.ajaxServiceInvokerProxy.InvokeService.send();
    this.marketSnapshotTimer.addEventListener(TimerEvent.TIMER,
    this.OnSnapshotTimerTick);
    this.marketSnapshotTimer.start();
    private function
    OnWebServiceResultArrived(event:ResultEvent) : void
    var marketSnapshotXml:XML = new XML(event.result);
    this.messageFramXmlList =
    marketSnapshotXml.child("MarketSnapshot").child("MessageFrameList")[0].child("MessageFram e");
    this.dgTopPosts.dataProvider = this.messageFramXmlList;
    this.btnCounter.label = this.count.toString();
    private function OnSnapshotTimerTick(event:TimerEvent) :
    void
    this.count++;
    this.ajaxServiceInvokerProxy.InvokeService.send();
    ]]>
    </mx:Script>
    <mx:WebService id="ajaxServiceInvokerProxy"
    wsdl="
    http://jehanzeb/ajaxserviceinvoker/ajaxserviceinvoker.asmx?wsdl"
    useProxy="false">
    <mx:operation name="InvokeService">
    <mx:request>
    <serviceWithComonentName>DetailedSnapshotComponent.MarketSnapshot@TADAWUL</serviceWithCom onentName>
    <parametersXml><![CDATA[ <Parameters/>
    ]]></parametersXml>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    <mx:Panel x="10" y="10" width="100%" height="100%"
    layout="absolute" title="Market View">
    <mx:RichTextEditor id="txtMarketViewResult" x="10" y="10"
    width="612" height="194" />
    <mx:DataGrid x="10" y="223" id="dgTopPosts" width="100%"
    height="303">
    <mx:columns>
    <mx:DataGridColumn headerText="Symbol Code"
    dataField="SymbolID" />
    <mx:DataGridColumn headerText="Last Time"
    dataField="LastTime" />
    <mx:DataGridColumn headerText="Net Change"
    dataField="NetChange" width="75"
    />
    <mx:DataGridColumn headerText="Percent Change"
    dataField="PercentChange" width="75" />
    <mx:DataGridColumn headerText="Previous Closed"
    dataField="PreviousClosed" width="75"/>
    <mx:DataGridColumn headerText="Close" dataField="Close"
    width="75"/>
    <mx:DataGridColumn headerText="Direction"
    dataField="Direction" width="75"/>
    <mx:DataGridColumn headerText="BidPrice"
    dataField="BidPrice" width="75"/>
    <mx:DataGridColumn headerText="AskPrice"
    dataField="AskPrice" width="75"/>
    <mx:DataGridColumn headerText="BidVolume"
    dataField="BidVolume" width="75"/>
    <mx:DataGridColumn headerText="AskVolume"
    dataField="AskVolume" width="75"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:LinkButton id="btnCounter" x="10" y="528" width="306"
    textAlign="left" label="" />
    </mx:Panel>
    </mx:Application>

    To achieve what you want, I would have two functions:
    * One populates the DataGrid for the first time, i.e. the
    inital load
    * The other does the 'update' on each interval, since there's
    logic required
    To update the DataGrid with only the rows that have changed,
    you're going to have to compare
    the incoming XML to the existing XML in the dataProvider of
    the DataGrid, then selectively update the dataProvider.
    You can use the
    getItemAt() and
    setItemAt() methods of the data provider to check each row
    against the incoming data. So, some example code:
    // This is the function which handles the result of your
    'updated data only' webservice
    private function handleUpdateInvoke (event:ResultEvent) :
    void {
    var incoming:XML = new XML(event.result);
    var someList:XMLList = incoming.somePattern;
    // For each data provider item, check the key and if it
    matches
    // one of the incoming keys, update it at that index
    var numRows = this.dgTopPosts.dataProvider.length;
    var existingDataRow:*
    for (var i:Number = 0; i < numRows; i++) {
    existingDataRow = this.dgTopPosts.dataProvider.getItemAt(i);
    for each (var newDataRow:* in someList) {
    if (existingDataRow.SymbolID == newDataRow.SymbolID) {
    this.dgTopPosts.dataProvider.setItemAt(newDataRow, i);
    }

  • Count the no. of rows in a column

    I want to count the no. of rows in APR_QTY column that are not equal to zero.
    SELECT DISTINCT
    SUPP_NAME,
    ITEM_NAME,
    (CASE WHEN BH_CAL_PERIOD=4 THEN TO_NUMBER(BI_QTY || '.' || BI_QTY_LS) ELSE 0 END)APR_QTY,
    (CASE WHEN BH_CAL_PERIOD=4 THEN BI_RATE ELSE 0 END)APR_RATE,
    (CASE WHEN BH_CAL_PERIOD=5 THEN TO_NUMBER(BI_QTY || '.' || BI_QTY_LS) ELSE 0 END)MAY_QTY,
    (CASE WHEN BH_CAL_PERIOD=5 THEN BI_RATE ELSE 0 END)MAY_RATE,
    (CASE WHEN BH_CAL_PERIOD=6 THEN TO_NUMBER(BI_QTY || '.' || BI_QTY_LS) ELSE 0 END)JUNE_QTY,
    (CASE WHEN BH_CAL_PERIOD=6 THEN BI_RATE ELSE 0 END)JUNE_RATE,
    (CASE WHEN BH_CAL_PERIOD=7 THEN TO_NUMBER(BI_QTY || '.' || BI_QTY_LS) ELSE 0 END)JUL_QTY,
    (CASE WHEN BH_CAL_PERIOD=7 THEN BI_RATE ELSE 0 END)JUL_RATE
    FROM
    OM_SUPPLIER,
    OM_ITEM,
    OT_BILL_HEAD,
    OT_BILL_ITEM,
    OT_BILL_ITEM_TED
    WHERE BI_BH_SYS_ID = BH_SYS_ID
    AND SUPP_CODE = BH_SUPP_CODE
    AND ITEM_CODE = BI_ITEM_CODE
    AND BH_SYS_ID = ITED_H_SYS_ID
    AND BI_SYS_ID = ITED_I_SYS_ID
    AND BH_TXN_CODE='SBRLRAW'
    GROUP BY BH_CAL_PERIOD,BH_TXN_CODE,SUPP_NAME,ITEM_NAME,BI_RATE,BI_QTY,BI_QTY_LS
    ORDER BY ITEM_NAME
    Message was edited by:
    yogeshyl

    Select sum(decode(apr_qty,0,0,1)) as cnt_apr_qty
    from ...

  • Row and column results to be calculated differently in BEx report

    Hi
    I have a BEx report which consists of profit centre characteristics in the row and headcount key fig in the column over 12 fiscal periods.  This headcount key fig has been set to Calculate Results as 'Last Value'.  This setting is correct because I want the Overall Result of each profit centre along the row to be the heacount value of period 12 or 11 or 10 depending on the period range entered by the user.  Due to this 'Last Value' setting, the Overall Results at the bottom of each fiscal period column also shows the last headcount value ie. the headcount value of the last profit centre displayed on the BEx report.  This is incorrect as the Overall Result should be the summation of headcount for all profit centres for fiscal month.
    What settings should I make to achieve my reporting requirement.  Please let me know. 
    Many thanks,
    Anthony

    Hi Uli
    Changing the 'Calculate result as' to 'counting all values' didn't work.
    What I'm getting from the BEx report is:
                   Headcounts...............................
    Profit Ctr  P1   P2  P3.....P12  Overall Results
    P120         5     6    6        7                7
    P121         6     5    8        9                9
    P122         6     9    8        7                7
    Overall
    Results     6     9     8       7                7
    The last row's Overall Results are incorrect.  It should sum up instead of taking the last profit centre P122 's periodic headcounts.  The last column's Overall Results are correct as they are the P12's headcounts.
    I want the BEx query to look like this:
                   Headcounts...............................
    Profit Ctr  P1   P2  P3.....P12  Overall Results
    P120         5     6    6        7                7
    P121         6     5    8        9                9
    P122         6     9    8        7                7
    Overall
    Results     17   20   22     23              23
    Cheers,
    Anthony

  • Search row and column for return value

    Dear Sir/Madam,
                               I have a problem for searching spreadsheet and hope you can help me out a bit.  Im pretty new to Labview and Im currently using Labview 8.0.  My task is to search the spreadsheet I have attached in row and column-wise, then return the corresponding value out.  I had an attempt in doing this as you can see from the vi that i have attached.  I try inputting the 'read from measurement file' into an array and using delete, index and search array I will be able to find the index value for the relevant row and column that i searched for by inputting them into an index array with the orginal array from the 'read from measurement file'.
                              So ultimately, when i enter a row value of 0.5 and a column value of 0.3, my output will be 1.688.
                              I can't see any mistakes in my logic but I getting really strange results, like I can read my data has been entered into an array but when i try deleting the first column and put it into another array, the orginal array with nothing deleted is outputted hence making my search to give out -1 value. So could you take a look please and give me any suggestion that can solve my problem or enhance the code a bit.  Thank you for your time.
    Best Regards,
    Coato
    P.s for some reason i can't attached the .lvm file of my data hence i have attached the excel version but i think you need to convert it back to .lvm for the 'read from measurement file' function to work.
    Attachments:
    Backswing compensation.csv ‏10 KB
    Backswing comnpensation2.vi ‏109 KB

    Your VI makes absolutely no sense to me, but maybe I don't understand what you are trying to do.
    You seem to have dynamic data with 6 signals and 48 points/channel. Now you reshape this into an array of dynamic data with 4x13 elements from which you slice out one row or column, resp. "delete from array" is NOT the correct tool to do this, use "Index array" with one index unwired to get a row or column as 1D array.
    So you end up with two 1D arrays of dynamic data that you search for DBL. It is difficult to understand how you want to search for an array element that corresponds to a scalar DBL value of 0.1. Your array elements are NOT DBLs but dynamic data, each containing many signals!
    There are two elements on all your data that are "3", the rest are zero. You will never find anything that is 0.1.
    Maybe you can convert your original dynamic data to a 2D array with "rows are signals" using "convert from dynamic data", then operate on the 2D array.
    Coato wrote:
                              So ultimately, when i enter a row value of 0.5 and a column value of 0.3, my output will be 1.688.
    Sorry, Please explain.
    Please make a VI containing a simple 2D aray as diagram constant that contains e.g. 5x5 typical values. Let us know what kind of result you expect from your algorithm..
    LabVIEW Champion . Do more with less code and in less time .

  • Setting number of rows and columns

    How do I set the number of rows and columns of a table, say 2348 rows by 3 columns?
    Then how do I quickly select the last row?
    Also, if I enter a formula in row 1 column 2, how do I quickly copy that formula down to row 1435, or to the end of the column? Dragging seems slow and awkward.

    I wish to add a few words to Jerrold responce.
    gjf12 wrote:
    How do I set the number of rows and columns of a table, say 2348 rows by 3 columns?
    Then how do I quickly select the last row?
    Also, if I enter a formula in row 1 column 2, how do I quickly copy that formula down to row 1435, or to the end of the column? Dragging seems slow and awkward.
    The process that you describe is inefficient.
    The efficient one is :
    create a table
    enter the formulas in a single row
    delete the rows below.
    Now, each newly inserted row will contain the formulas.
    From my point of view, it's when this is done that it will be interesting to apply a script adding rows.
    Here is a script inserting rows.
    --[SCRIPT insertRows]
    Enregistrer le script en tant que Script : insertRows.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner une cellule au-dessous de laquelle vous voulez insérer des lignes.
    menu Scripts > Numbers > insertRows
    Le script vous demande le nombre de lignes désiré puit insère celles-ci.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    --=====
    Save the script as a Script: insertRows.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select a cell below which you want to insert rows.
    menu Scripts > Numbers > insertRows
    The script ask you the number of rows to insert then it does the required insertion.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    Save this script as a … Script in the "Folder Actions Scripts" folder
    <startupVolume>:Library:Scripts:Folder Action Scripts:
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2010/01/13
    --=====
    on run
    set defaultValue to 100
    if my parleAnglais() then
    set myInteger to my askAnumber("Insert how many rows ?", defaultValue, "i")
    else
    set myInteger to my askAnumber("Combien de lignes voulez-vous insérer ?", defaultValue, "i")
    end if
    set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    repeat myInteger times
    add row below row rowNum2
    end repeat
    end tell
    end run
    --=====
    on getSelParams()
    local r_Name, t_Name, s_Name, d_Name, col_Num1, row_Num1, col_Num2, row_Num2
    set {d_Name, s_Name, t_Name, r_Name} to my getSelection()
    if r_Name is missing value then
    if my parleAnglais() then
    error "No selected cells"
    else
    error "Il n'y a pas de cellule sélectionnée !"
    end if
    end if
    set two_Names to my decoupe(r_Name, ":")
    set {row_Num1, col_Num1} to my decipher(item 1 of two_Names, d_Name, s_Name, t_Name)
    if item 2 of two_Names = item 1 of two_Names then
    set {row_Num2, col_Num2} to {row_Num1, col_Num1}
    else
    set {row_Num2, col_Num2} to my decipher(item 2 of two_Names, d_Name, s_Name, t_Name)
    end if
    return {d_Name, s_Name, t_Name, r_Name, row_Num1, col_Num1, row_Num2, col_Num2}
    end getSelParams
    --=====
    set {rowNumber, columnNumber} to my decipher(cellRef,docName,sheetName,tableName)
    apply to named row or named column !
    on decipher(n, d, s, t)
    tell application "Numbers" to tell document d to tell sheet s to tell table t to return {address of row of cell n, address of column of cell n}
    end decipher
    --=====
    set { d_Name, s_Name, t_Name, r_Name} to my getSelection()
    on getSelection()
    local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
    tell application "Numbers" to tell document 1
    repeat with i from 1 to the count of sheets
    tell sheet i
    set x to the count of tables
    if x > 0 then
    repeat with y from 1 to x
    try
    (selection range of table y) as text
    on error errMsg number errNum
    set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
    return {theDoc, theSheet, theTable, theRange}
    end try
    end repeat -- y
    end if -- x>0
    end tell -- sheet
    end repeat -- i
    end tell -- document
    return {missing value, missing value, missing value, missing value}
    end getSelection
    --=====
    on decoupe(t, d)
    local l
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to ""
    return l
    end decoupe
    --=====
    Asks for an entry and checks that it is an floating number
    set myInteger to my askAnumber(Prompt, DefaultValue, "i")
    set myFloating to my askAnumber(Prompt, DefaultValue, "f")
    on askAnumber(lPrompt, lDefault, ForI)
    local lPrompt, lDefault, n
    tell application (path to frontmost application as string)
    if ForI is "f" then
    set n to text returned of (display dialog lPrompt & " (" & (1.2 as text) & ")" default answer lDefault as text)
    try
    set n to n as number (* try to convert the value as an number *)
    return n
    on error
    if my parleAnglais() then
    display alert "The value needs to be a floating number." & return & "Please try again."
    else
    display alert "La valeur saisie doit être un nombre décimal." & return & "Veuillez recommencer."
    end if
    end try
    else
    set n to text returned of (display dialog lPrompt default answer lDefault as text)
    try
    set n to n as integer (* try to convert the value as an integer *)
    return n
    on error
    if my parleAnglais() then
    display alert "The value needs to be an integer." & return & "Please try again."
    else
    display alert "La valeur saisie doit être un nombre entier." & return & "Veuillez recommencer."
    end if
    end try -- 1st attempt
    end if -- ForI…
    end tell -- application
    Here if the first entry was not of the wanted class
    second attempt *)
    tell application (path to frontmost application as string)
    if ForI is "f" then
    set n to text returned of (display dialog lPrompt & " (" & (1.2 as text) & ")" default answer lDefault as text)
    try
    set n to n as number (* try to convert the value as an number *)
    return n
    on error
    end try
    else
    set n to text returned of (display dialog lPrompt default answer lDefault as text)
    try
    set n to n as integer (* try to convert the value as an integer *)
    return n
    on error
    end try -- 1st attempt
    end if -- ForI…
    end tell -- application
    if my parleAnglais() then
    error "The value you entered was not numerical !" & return & "Goodbye !"
    else
    error "La valeur saisie n’est pas numérique !" & return & "Au revoir !"
    end if
    end askAnumber
    --=====
    on parleAnglais()
    local z
    try
    tell application "Numbers" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) mercredi 13 janvier 2010 12:43:34

  • Table -- sum of rows and columns?

    I was wondering if anyone has a suggestion to how I can easily generate the sum of each row and column in a two dimensional table? This is what I've got so far:
    public class SumRowsColumns {
        public static void main (String[] args) {
         int[][] table = new int[2][3];
         // gets the values
         for (int i = 0; i < table.length;
              i++) {
             for (int j = 0; j < table.length;
              j++)
              table[i][j] = Terminal.lesInt(); // Terminal is a class that can read the terminal input
         System.out.println("\t\t\t\tSum:");
         // prints the values
         for (int i = 0; i < table.length;
         i++) {
         for (int j = 0; j < table[i].length;
              j++) {
              System.out.print("\t" + table[i][j]);
         System.out.println();
         // sum of first column
         int sumColumn = 0;
         for (int i = 0; i < table.length;
         i++) {
              sumColumn += table[i][0];
         System.out.print("\nSum:\t");
         System.out.println(sumColumn);
    Example of output:
    1
    2
    3
    4
    5
    6
                                    Sum:
            1       2       3
            4       5       6
    Sum:    5This is the output I'd like:
    1
    2
    3
    4
    5
    6
                                    Sum:
            1       2       3     6
            4       5       6     15
    Sum:    5     7     9One way of getting the sum for all the columns is to make a for-loop for each one of them, but there has to be a better way. I could apply the same hack to get the sum of the rows, but I still wouldn't know how to get the layout I want.

    After many hours of frustration I finally solved it (for-loops can be confusing, man) after I got a hint from a post in another forum: http://www.linuxquestions.org/questions/showthread.php?postid=624021#post624021
    A more logical name to the integers actually helped a lot too. And here's the final product:
    public class SumRowsColumns {
        public static void main (String[] args) {
         int[][] table = new int[2][3];
         // gets the values
         for (int row = 0; row < table.length;
              row++) {
             for (int col = 0; col < table[row].length;
               col++)
              table[row][col] = Terminal.lesInt(); // Terminal is a class that reads the terminal input
         System.out.println("\t\t\t\tSum:");
         // prints the values and sum of each row
         for (int row = 0; row < table.length;
              row++) {
             for (int col = 0; col < table[row].length;
               col++) {
              System.out.print("\t" + table[row][col]);
             int sum = 0;
             for (int col = 0; col < table[0].length;
               col++) {
              sum += table[row][col];
             System.out.println("\t" + sum);
         System.out.print("\nSum:");
         // sum of each column
         for (int col = 0; col < table[0].length; // table[0].length is the length of row 0 (the number of columns)
              col++) {
             int sum = 0;
             for (int row = 0; row < table.length; // table.length is the number of rows
               row++) {
              sum += table[row][col];
             System.out.print("\t" + sum);
         System.out.println();
    }

  • Dynamic Table - Add rows and columns in same table

    Hi there,
    I wonder if someone could help please? I'm trying to create and table where a user can add both rows and columns (preferably with separate buttons) but am having trouble trying to figure out how to do this. Is it possible? If so how? I'm not familar with script but have found examples of seprate tables where you can add a row and then another table where you can add columns and essentailly want to merge the two but cannot make it work.
    Any help much appreciated!
    Thanks,
    Ken

    It is great example....you can learn the concepts there and apply....however you may have to think twice before you implement column adding dynamically....because the technique here is make copy of what we already have and reproduce it as a new item and this technique works great for rows as they all have every thing in common. But when it comes to columns it may have unique visible identity as column head and displaying repeatedly the same column head may not look good. Of-Course you can do few extra lines of code and change the column appearance based on users input each time. Situations where users need to add additional column is very unlikely (sure your requirement might be an exception).
    Key in allowing adding/removing instances is managing design mode settings under Object>>Binding>>....and select the checkbox "Repeat <subform/row/...> for Each Data Item" and then set Min, Max and Initial count values.
    Also you need to club your effots by using simple scipt with button clicks....
    for the example refered in URL you posted following is what I did to make the first table allow Adding/Removing Rows....
    1. Opened the form in LC designer.
    2. Add two buttons AddRow & RemoveRow right next to RemoveColumn
    3. For AddRow I used following JS code....
          Table1._Row1.addInstance(1);//that means any time this button is clicked a new instance of Row1 is added use _Row2 or Row3 based on your needs
          var fVersion = new Number(xfa.host.version); // this will be a floating point number like "7.05"
          if (fVersion < 8.0) // do this for Acrobat versions earlier than 8.0
           // make sure that the new instance is properly rendered
           xfa.layout.relayout();
    4.  For RemoveRow I used following JS code....
         Table1._Row1.removeInstance(1);//Syntax is...<objectReference>.removeInstance(<index of the repeating object that needs to be removed>); //in this case since we used 1 alwasys second object from top gets deleted.
          var fVersion = new Number(xfa.host.version); // this will be a floating point number like "7.05"
          if (fVersion < 8.0) // do this for Acrobat versions earlier than 8.0
           // make sure that the new instance is properly rendered
           xfa.layout.relayout();
    5. Now time to update settings at Object>>Binding tab and set "Repeat......" and also set Min, Max and Initial count as explained above.
         Those settings needs to be updated for Row1 (or your choice of row) of the table
    6. Set the Height to Expand of the Subform, where the table is housed....  this is done under Layout pallet
    7. Save the PDF as dynamic template and verify the results...
    If you still run into issues I can send you copy that works on my machine, but you need send me an email at n_varma(AT)lycos.com
    Good luck,

  • Exporting data in rows and columns and loading in RDBMS

    <p>I have a scenario wherein i want to export data from HyperionEssbase in <b>rows and coulmns</b> and <b>load it into</b><b>RDBMS</b>. I can load data into RDBMS using informatica if theflat file exported is in form of rows and columns.But when i exportthe file using Hyperion Essbase 9 i get it in from of alldimensions and then the fact value which is not how i want. I wantdata in relational from in flat file itself(row,column).</p><p>Looking forard to your suggestions..Thanks in advance..</p>

    <p>Thanks <b>willjordan</b> and <b>twakim</b> for yoursuggestions..</p><p> </p><p>I tried both the techniques and both worked...</p><p>With reference to the technique suggested by <b>twakim</b> , I was able to use that in Hyperion Essbase 9..But in myreal scenario the cube is in Hyperion Essbase 6.5.4.2..Can i usethis Custom defined functions in Hyperion Essbase 6.5.4.2..and ifso how as there is no concept of Analytical server there???</p><p> </p><p>Please help me in this issue???<br></p>

  • How can I print row and column headings?

    In AW6 I was able to select Appleworks in the print window and check if I wanted to print row and/or column headings. I have not been able to find how to do this in Numbers. Can anyone tell me how?
    Paco

    Paco wrote:
    I have not been able to find how to do this in Numbers.
    Perfectly logical, the feature is unavailable.
    Workaround:
    Use a row header and a column header to mimic the missing feature.
    In cell B1 I entered
    =CHAR(CODE("A")-1+COLUMN())
    and applied fill to the right
    CAUTION, this formula is OK only from colum B thru column Z.
    In cell A2 I entered
    =ROW()
    and applied Fill Down
    Then convert column A as header one
    convert row A as header one.
    Yvan KOENIG (from FRANCE dimanche 22 février 2009 12:28:34)

  • Adding Rows and Columns to a table depending requirements

    Hi all,
    I have created a table with one row and 2 columns of a table. My client requested adding form one to 3 columns of the right table and rows as well, depending business requirements.
    I can add coding add columns on the right, but I cannot add rows because the columns dynamic.
    I tried to write the coding for adding rows but it is not successful.  Please help.
    event : click - add colum button
    for (var i = 0; i < form1.page1.Table1._Row1.count; i++){
    var newrow = form1.page1.Table1.resolveNode("Row1[" + i + "]");
    var newrow2 = form1.page1.Table1.resolveNode("HeaderRow[" + i + "]");
    newrow._Col3D.addInstance(0);
    newrow2._Col3D.addInstance(0);
    i also published my file for your reviewing.
    https://workspaces.acrobat.com/?d=xcgcfby89J-IHenn-8xeaQ
    Thank you very much,
    Cindy

    When you are adding instances it uses the default properties of the object...
    If its hidden as a default value in the form and you add an instance, the new instance will be hidden..
    So if you have 3 columns in your default row and trying to add an instance withthe 5 columns it will only add a row with 3 columns..
    If you want to add the columns to the table, you must add the column to each new row instance.
    E.g.:
    var intCount = xfa.resolveNode("page1.table1.Row1").instanceManager.count;
    form1.page1.table1._Row1.addInstance(1);
    xfa.resolveNode("page1.table1.Row1[" + intCount.toString() + "].Col3D").addInstance(1);

  • How to set Tile count column or count row?

    How to set Tile count column or count row? If not can do, How
    to adjust count row or count column?
    Thx for all idea.

    The Tile container's number of columns and rows is calculated
    based on each child's width and height (or based on tileWidth and
    tileHeight which you can set). If you need more control over the
    layout, use Grid.

  • Sum calculated rows and columns

    I have written a SQL report to count the number of offenses by levels of disciplinary actions.  Now I want to total
    the counts for the rows and columns.  How do I do this? Below is my code.  It produces column headings with counts.  Ie.
    Offense Description   Level I  Level II  Susps Terms
    2 Minor Violations      0         1       
    0    0  
    SELECT
    UPPER(DESCRIPTION) as OFFENSE,
    SUM(CASE
    WHEN OUTCOME = 'LEVEL I'
    THEN 1
    ELSE 0
    END) as LEVELI,
    SUM(CASE
    WHEN OUTCOME = 'LEVEL II'
    THEN 1
    ELSE 0
    END) as LEVELII,
    SUM(CASE
    WHEN OUTCOME = 'SUSPEND'
    THEN 1
    ELSE 0
    END) as SUSPEND,
    SUM(CASE
    WHEN OUTCOME = 'TERM'
    THEN 1
    ELSE 0
    END) as TERM
    FROM
    PAGRDI
    Where
    R_DATE >= '2014-01-01' and R_DATE <= '2014-01-31'
    Group by
    DESCRIPTION
    Order by
    OFFENSE

    Hi Wildcatgirl,
    According to your description, you have used T-SQL to get the counts for different OUTCOME. Now you want to get the total for each OFFENSE and OUTCOME. Right?
    In this scenario, since you have already get those counts with T-SQL query, so in your dataset it will have data fields below: OFFENSE, LevelI, LevelII, SUSPEND, TERM. We just need to drag these data fields into a table, add a column at the end of the table
    and use expression to sum the counts for different OUTCOME. Then we can add a total for the detail row. We have tested this scenario in our local environment. Here are screenshots for your reference:
    Reference:
    Tables (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Refreshing JTable contents (rows and columns) handling.

    Hi,
    I have a general question related to refreshing the contents of JTable and handling some application specific requirements.In our application we are planning to refresh the contents of JTable automatically after certain period of time by fetching data from database and update the JTable contents or user has clicked refresh button.
    But following scenarios we are planning to handle when refresh is called automatically or user has clicked refresh button.
    1) User is working with data of JTable. Like rows of JTable has checkBoxes and user selects them and doing operation like viewing the details of selected rows in new details dialog. So if refreshing is done then the selection will be lost if I update the whole data in JTable.
    a)Will it be possible to append the data at the end of JTable rows without disturbing the existing JTable contents.
    b) Is it feasible to compare the data of existing rows and newly fetched rows and update only the rows whose values are changed in database or update specifically updated columns. But this comparision for finding changed values will result in performance problems.So are there any other alternatives of doing this, ideas are most welcome.
    c) Simple way is to alert the user that data will be updated and everything will be refreshed will be the choice in worst case.
    I guess many may have encountered such problems and may have solved it depending on the product requirements.
    Ideas and suggestions are most welcome.
    Regards.

    Hi,
    Here are my views and my assumptions.
    Assumptions :
    1) Your JTable is populated with list of Objects.
    2) Your tables in database is having columns like created date, created time, updated date updated time
    3) Order by clause for all the time will remain same.
    If these assumptions are correct then I think you can achieve your goal.
    Here how it is.
    Your application session will maintain last db hit time and will maintain for every hit that applicate made to fetch data from db.
    When object is created on the server side once it fetch data from table it will compare the created date/time or update date/time with the session varibale that holds last visit date/time. Based on this flag need to be set to indicate if this item is added/updated/deleted since last visit.
    And when all these object is returned to your client, the table model will iterate through the list and based on object index in the list and and if object is changed will update only that perticular row.
    Hope this is what you want to achieve.
    Regards

  • How to get multiple records in one row and different column

    Hi All,
    I am using oracle database 11g
    and i have a two tables table_1, table_2
    table_1 having columns
    emp_no
    first_name
    middle_name
    last_name
    email
    and table_2 having columns
    emp_no
    phone_type
    phone_number
    and having entires
    emp_no phone_type phone_number
    1001 MOB 9451421452
    1001 WEMG 235153654
    1001 EMG 652341536
    1002 MOB 9987526312
    1003 WEMG 5332621456
    1004 EMG 59612356
    Now i want the output of values with phone type as MOB or WEMG in a single row with different columns
    emp_no first_name middle_name last_name email mobile officeno
    1001 mark null k [email protected] 9451421452 235153654
    1002 john cena gary [email protected] 9987526312 null
    1003 dany null craig [email protected] null 5332621456
    1004 donald finn sian [email protected] null null
    can i have any inputs to achive this???
    Regards
    $sid

    Frank Kulash wrote:
    sonething like this:Frank, you missed aggregate function (pivot requires one). However main thing is it will cause ORA-01748:
    with table_1 as (
                     select 1001 emp_no,'mark' first_name,null middle_name,'k'last_name,'[email protected]' email from dual union all
                     select 1002,'john','cena','gary','[email protected]' from dual union all
                     select 1003,'dany',null,'craig','[email protected] null' from dual union all
                     select 1004,'donald','finn','sian','[email protected]' from dual
         table_2 as (
                     select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
                     select 1001,'WEMG',235153654 from dual union all
                     select 1001,'EMG',652341536 from dual union all
                     select 1002,'MOB',9987526312 from dual union all
                     select 1003,'WEMG',5332621456 from dual union all
                     select 1004,'EMG',59612356 from dual
    SELECT     *
    FROM     table_1      t1
    JOIN     table_2      t2  ON  t1.emp_no = t2.emp_no
    PIVOT     (    max(t2.phone_number)
         FOR  t2.phone_type  IN  ( 'MOB'   AS mob
                                 , 'WEMG'  AS wemg
            FOR  t2.phone_type  IN  ( 'MOB'   AS mob
    ERROR at line 19:
    ORA-01748: only simple column names allowed hereYou need to:
    with table_1 as (
                     select 1001 emp_no,'mark' first_name,null middle_name,'k' last_name,'[email protected]' email from dual union all
                     select 1002,'john','cena','gary','[email protected]' from dual union all
                     select 1003,'dany',null,'craig','[email protected] null' from dual union all
                     select 1004,'donald','finn','sian','[email protected]' from dual
         table_2 as (
                     select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
                     select 1001,'WEMG',235153654 from dual union all
                     select 1001,'EMG',652341536 from dual union all
                     select 1002,'MOB',9987526312 from dual union all
                     select 1003,'WEMG',5332621456 from dual union all
                     select 1004,'EMG',59612356 from dual
         table_3 as (
                     select  t1.emp_no,first_name,middle_name,last_name,email,
                             phone_type,phone_number
                       FROM     table_1      t1
                       LEFT JOIN     table_2      t2  ON  t1.emp_no = t2.emp_no
    SELECT     *
    FROM     table_3
    PIVOT     (    max(phone_number)
         FOR  phone_type  IN  ( 'MOB'   AS mob
                                 , 'WEMG'  AS wemg
        EMP_NO FIRST_ MIDD LAST_ EMAIL                     MOB       WEMG
          1004 donald finn sian  [email protected]
          1003 dany        craig [email protected] null            5332621456
          1001 mark        k     [email protected]      9451421452  235153654
          1002 john   cena gary  [email protected]    9987526312
    SQL>SY.

Maybe you are looking for

  • HP LaserJet P2055dn Printer won't print the last page of documents & envelope problem

    My HP LaserJet P2055dn Printer won't print the last page of documents until i send another document, then it will print the last page of the previous document, but omit the last page of the current document.  I need to keep printing a blank page or a

  • HELP! TV connecting to Mac problem

    I really hope someone can help. No one has answers very frustrating. I connected my Macbook Pro to my Samsung LED. For awhile it worked great. Then after 2 weeks of not using it I plug in the Mini display port and there is a HUGE black bar on the lef

  • JPA and Entity manager.

    Hi all, I have a "simple" question: Should I create a class to manage entity manager and entity manager factory on JPA2? Why do I ask that? Because I read on J2EE tutorial: With a container-managed entity manager, an EntityManager instance's persiste

  • IPhoto (iLife '11) cannot open iPhoto '09 library

    I upgraded from iPhoto '09 to iPhoto '11 and am unable to open my old library. Any guidance would be appreciated. MS

  • Ring sound setting

    Hello, I keep setting my ringtone sound level at maximum and it keeps reseting to the middle all the time. The high level is very important for my work. Any solutions or news??? Help much appreciated