Help with rsvp total

I am arranging a trip for a group of middle school / high school students. I have a sheet that lists the student info and then a box to check that they are confirmed. At that bottom of that column I'd like to have the total of the number of people who are confirmed. In other words when I check the box above, I want it to tally those check marks with a total of all check marks. Can you please help me with this?
Thanks!

Rick Smith wrote:
Thanks! Great info. on the main chart I have name, last, grade, gender, then in the main table under 'grade" which I'm thinking will effect your formula a bit. So under 'grade' i may have numbers 7-12 in there.
You can easily make that adjustment. It will simplify the AND statement by eliminating one term.
I'm not sure what the adding of the other 2 columns do? It seems like I would have to add about 10 of these extra columns, is that right? Seems like I could make my breakout 'look' for those values in some way, but I may be wrong.
I'd be surprised if you find an easier way to do this part. The extra columns in the main table determine where the data will go in the breakout table. To make that decision in the breakout table would be very difficult.
Jerry

Similar Messages

  • Help with this total number

    hi to all experts,
    i have a requirement to print the sub total of quantity  for a particular delievery order and material . but im not getting the exact quantity ( it should be  65000) im getting 780000 what might be the error.It is happening only in DO for others the quantity is correct . what might be the error. Please help me with this issue . Here is the report
    TABLES: vbak, vbrk.
    TABLES: likp. "CN5
    DATA: BEGIN OF t_itab OCCURS 50,
            vbeln LIKE vbrk-vbeln,
            kunag LIKE vbrk-kunag,
            name1 LIKE kna1-name1,
            fkdat LIKE vbrk-fkdat,
            kunnr LIKE likp-kunnr, "CN5
          END OF t_itab.
    DATA: BEGIN OF t_itab1 OCCURS 50,
            name1 LIKE kna1-name1,
            fkdat LIKE vbrk-fkdat,
            vbeln LIKE vbrp-vbeln,
            venum LIKE vekp-venum,
            matnr LIKE vbrp-matnr,
    *    start insert CN4
            matwa LIKE vbrp-matwa,
    *    end insert CN4
            vhilm LIKE vekp-vhilm,
            zuonr LIKE vbrk-zuonr,
            ihrez LIKE vbkd-ihrez,
            posnr LIKE vbrp-posnr,
            aubel LIKE vbrp-aubel,
            aupos LIKE vbrp-aupos,
            vgbel LIKE vbrp-vgbel,
            maktx LIKE makt-maktx,
            desctn LIKE makt-maktx,
            bstkd LIKE vbkd-bstkd,
    *        ihrez LIKE vbkd-ihrez,
            vemng TYPE p,
            brgew LIKE vekp-brgew,
            ntgew LIKE vekp-ntgew,
    *        tavol LIKE vekp-tavol,
            tavol TYPE p DECIMALS 5,
            ctnno TYPE i,
            kunag LIKE vbrk-kunag,
            kunnr LIKE likp-kunnr, "CN5
          END OF t_itab1.
    DATA: BEGIN OF t_canc OCCURS 50,
            sfakn LIKE vbrk-sfakn,
            fkart LIKE vbrk-fkart,
          END OF t_canc.
    DATA: t_disp LIKE t_itab1 OCCURS 50 WITH HEADER LINE.
    DATA: t_disp1 LIKE t_itab1 OCCURS 50 WITH HEADER LINE.
    DATA: g_date(10),
          g_tot_ctnno TYPE i,
          g_tot_vemng TYPE p,
          g_tot_brgew LIKE vekp-brgew,
          g_tot_ntgew LIKE vekp-ntgew,
    *      g_tot_tavol LIKE vekp-tavol,
          g_tot_tavol TYPE p DECIMALS 5,
          g_gtot_ctnno TYPE i,
          g_gtot_vemng TYPE p,
          g_gtot_brgew LIKE vekp-brgew,
          g_gtot_ntgew LIKE vekp-ntgew,
    *      g_gtot_tavol LIKE vekp-tavol.
          g_gtot_tavol TYPE p DECIMALS 5.
    SELECTION-SCREEN BEGIN OF BLOCK mysel WITH FRAME TITLE text-003.
    SELECT-OPTIONS:
      p_vkorg FOR vbak-vkorg OBLIGATORY,
      date FOR sy-datum OBLIGATORY.
    *--> Start delete "CN6
    *  cust FOR vbrk-kunag,
    *<--End delete "CN6
    *--> Start insert "CN6
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS sold RADIOBUTTON GROUP pt.      "Sold To Party
    SELECTION-SCREEN COMMENT 3(20) text-001 FOR FIELD sold.
    SELECTION-SCREEN POSITION 45.
    PARAMETERS ship RADIOBUTTON GROUP pt.     "Ship To Party
    SELECTION-SCREEN COMMENT 48(20) text-002 FOR FIELD ship.
    SELECTION-SCREEN END OF LINE.
    *<-- End insert "CN6
    SELECT-OPTIONS : so_kunnr FOR likp-kunnr.  "CN5
    SELECTION-SCREEN END OF BLOCK mysel.
    *         START-OF-SELECTION.                                          *
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM get_disp_data.
      PERFORM refresh_data.
      PERFORM display_rep.
    *&      Form  CheckAuthority
    *       text
    *      -->VKORG      text
    *      -->VTWEG      text
    FORM checkauthority USING vkorg vtweg.
      CALL FUNCTION 'Z_AUTHORITY_CHECK'
        EXPORTING
          module             = 'SD'
          vkorg              = vkorg
    *     EKORG              =
    *     WERKS              =
    *     BUKRS              =
          vtweg              = vtweg
    *     SPART              =
    *     PRCTR              =
        EXCEPTIONS
          no_authority       = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "CheckAuthority
    *       FORM get_data                                                 *
    FORM get_data.
    *--> Start delete "CN6
    *  DATA:chrvkorg LIKE vbrk-vkorg,
    *       chrvtweg LIKE vbrk-vtweg.
    *<--End delete "CN6
    *--> Start insert "CN6
      DATA: BEGIN OF l_vbrk OCCURS 0,
              vbeln LIKE t_itab-vbeln,
              fkdat LIKE t_itab-fkdat,
              kunnr LIKE t_itab-kunnr,
              chrvkorg LIKE vbrk-vkorg,
              chrvtweg LIKE vbrk-vtweg,
            END OF l_vbrk.
    *<--End insert "CN6
    *--> Start delete "CN5
    *  SELECT vbeln fkdat kunag vkorg vtweg INTO (t_itab-vbeln, t_itab-fkdat,
    *                                             t_itab-kunag, chrvkorg, chrvtweg)
    *                           FROM vbrk  WHERE fkdat IN date
    *                                        AND kunag IN cust
    *                                        AND vkorg IN p_vkorg
    *                                        AND fkart = 'ZF2'.
    *<--End delete "CN5
    *--> Start delete "CN6
    *--> Start insert "CN5
    *  SELECT a~vbeln a~fkdat a~kunag a~vkorg a~vtweg c~kunnr
    *    INTO (t_itab-vbeln, t_itab-fkdat, t_itab-kunag, chrvkorg, chrvtweg, t_itab-kunnr)
    *    FROM vbrk AS a
    *    INNER JOIN vbrp AS b ON a~vbeln = b~vbeln
    *    INNER JOIN likp AS c ON b~vgbel = c~vbeln
    *    WHERE a~fkdat IN date
    *      AND a~kunag IN cust
    *      AND a~vkorg IN p_vkorg
    *      AND a~fkart = 'ZF2'
    *      AND c~kunnr IN so_kunnr.
    *<--End insert "CN5
    *<--End delete "CN6
    *--> Start insert "CN6
      IF sold ='X'.
        SELECT vbeln fkdat kunag vkorg vtweg
          INTO TABLE l_vbrk
          FROM vbrk
          WHERE fkdat IN date
            AND vkorg IN p_vkorg
            AND fkart = 'ZF2'
            AND kunag IN so_kunnr.
      ELSEIF ship = 'X'.
        SELECT a~vbeln a~fkdat c~kunnr a~vkorg a~vtweg
          INTO TABLE l_vbrk
          FROM vbrk AS a
          INNER JOIN vbrp AS b ON a~vbeln = b~vbeln
          INNER JOIN likp AS c ON b~vgbel = c~vbeln
          WHERE a~fkdat IN date
          AND a~vkorg IN p_vkorg
          AND a~fkart = 'ZF2'
          AND c~kunnr IN so_kunnr.
      ENDIF.
      LOOP AT l_vbrk.
        t_itab-vbeln = l_vbrk-vbeln.
        t_itab-fkdat = l_vbrk-fkdat.
        t_itab-kunnr = l_vbrk-kunnr.
    *<--End insert "CN6
        PERFORM checkauthority USING l_vbrk-chrvkorg l_vbrk-chrvtweg.
        IF sy-subrc = 0.
          APPEND t_itab.
          CLEAR t_itab.
        ENDIF.
    *    CLEAR chrvtweg.   "CN6
      ENDLOOP.    "CN6
      PERFORM check_cancelled_doc.
      LOOP AT t_itab.
        SELECT SINGLE name1 INTO (t_itab-name1)
                            FROM kna1
    *                        WHERE kunnr = t_itab-kunag. "CN5
                            WHERE kunnr = t_itab-kunnr. "CN5
        MODIFY t_itab.
        CLEAR t_itab.
      ENDLOOP.
      PERFORM get_data1.
      PERFORM get_data2.
    ENDFORM.                    "get_data
    *       FORM check_cancelled_doc                                      *
    FORM check_cancelled_doc.
    *--> Start delete "CN6
    *SELECT fkart sfakn INTO (t_canc-fkart, t_canc-sfakn)
    *                       FROM vbrk WHERE fkdat IN date
    *                                 AND   kunag IN so_kunnr
    *                                 AND   vkorg IN p_vkorg
    *                                 AND   fkart = 'ZS1'.
    *      APPEND t_canc.
    *      CLEAR t_canc.
    *    ENDSELECT.
    *<-- End delete "CN6
    *--> Start insert "CN6
      IF sold ='X'.
        SELECT fkart sfakn INTO (t_canc-fkart, t_canc-sfakn)
                           FROM vbrk WHERE fkdat IN date
                                     AND   kunag IN so_kunnr
                                     AND   vkorg IN p_vkorg
                                     AND   fkart = 'ZS1'.
          APPEND t_canc.
          CLEAR t_canc.
        ENDSELECT.
      ELSE.
        SELECT fkart sfakn INTO (t_canc-fkart, t_canc-sfakn)
                          FROM vbrk WHERE fkdat IN date
                                    AND   vkorg IN p_vkorg
                                    AND   fkart = 'ZS1'.
          APPEND t_canc.
          CLEAR t_canc.
        ENDSELECT.
      ENDIF.
    *<-- End insert "CN6
      LOOP AT t_itab.
        READ TABLE t_canc WITH KEY sfakn = t_itab-vbeln.
        IF sy-subrc = 0.
          DELETE t_itab WHERE vbeln = t_canc-sfakn.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "check_cancelled_doc
    *       FORM get_data1                                                *
    FORM get_data1.
      LOOP AT t_itab.
    *--> Start insert "CN6
        t_itab1-kunnr = t_itab-kunnr.
    *<-- End insert "CN6
    * start delete CN4
    *    SELECT vbeln posnr matnr aubel aupos vgbel
    *                  INTO (t_itab1-vbeln, t_itab1-posnr,
    *                        t_itab1-matnr, t_itab1-aubel, t_itab1-aupos, t_itab1-vgbel)
    *                  FROM vbrp
    *                  WHERE vbeln = t_itab-vbeln.
    * end delete CN4
    *  start insert CN4
        SELECT vbeln posnr matnr aubel aupos vgbel matwa
                    INTO (t_itab1-vbeln, t_itab1-posnr,
                          t_itab1-matnr, t_itab1-aubel, t_itab1-aupos, t_itab1-vgbel, t_itab1-matwa)
                    FROM vbrp
                    WHERE vbeln = t_itab-vbeln.
    *  end insert CN4
          MOVE-CORRESPONDING t_itab TO t_itab1.
          APPEND t_itab1.
          CLEAR t_itab1.
        ENDSELECT.
      ENDLOOP.
    *  SORT t_itab1 BY matnr vgbel.
    *  SORT t_itab1 BY fkdat name1 ihrez.
      DELETE ADJACENT DUPLICATES FROM t_itab1 COMPARING matnr vgbel.
      LOOP AT t_itab1.
        SELECT SINGLE bstkd INTO (t_itab1-bstkd)
                            FROM vbkd
                            WHERE vbeln = t_itab1-aubel.
        SELECT SINGLE ihrez INTO (t_itab1-ihrez)
                            FROM vbkd
                            WHERE vbeln = t_itab1-aubel
                              AND posnr = t_itab1-aupos.
    *CN2 inserted start by yongchun
        IF sy-subrc NE 0.
          SELECT SINGLE ihrez INTO (t_itab1-ihrez)
                              FROM vbkd
                              WHERE vbeln = t_itab1-aubel
                                AND posnr = '000000'.
        ENDIF.
    *CN2 inserted end by yongchun
        SELECT SINGLE maktx INTO (t_itab1-maktx)
                            FROM makt
                            WHERE matnr = t_itab1-matnr.
        SELECT SINGLE zuonr INTO (t_itab1-zuonr)
                            FROM vbrk
                            WHERE vbeln = t_itab1-vbeln.
        MODIFY t_itab1.
        CLEAR t_itab1.
      ENDLOOP.
    ENDFORM.                                                    "get_data1
    *       FORM get_data2                                                *
    FORM get_data2.
      LOOP AT t_itab1.
        SELECT venum vemng INTO (t_itab1-venum, t_itab1-vemng)
                            FROM vepo
                            WHERE vbeln = t_itab1-vgbel
                            AND   matnr = t_itab1-matnr.
          SELECT SINGLE brgew ntgew vhilm
                       INTO (t_itab1-brgew, t_itab1-ntgew,
                             t_itab1-vhilm)
                       FROM vekp
    *                   WHERE vbeln_gen = t_itab1-vgbel
                       WHERE vpobjkey = t_itab1-vgbel
                       AND   venum = t_itab1-venum.
          SELECT SINGLE volum INTO (t_itab1-tavol)
                              FROM mara
                              WHERE matnr = t_itab1-vhilm.
          IF sy-subrc = 0.
            PERFORM convert_volume USING t_itab1-vhilm CHANGING t_itab1-tavol.
          ENDIF.
          SELECT SINGLE maktx INTO (t_itab1-desctn)
                              FROM makt
                              WHERE matnr = t_itab1-vhilm.
          MOVE-CORRESPONDING t_itab1 TO t_disp.
          APPEND t_disp.
          CLEAR t_disp.
        ENDSELECT.
      ENDLOOP.
    ENDFORM.                                                    "get_data2
    *       FORM get_disp_data                                            *
    FORM get_disp_data.
      DATA: l_ctnno TYPE i,
            l_vemng TYPE p,
            l_brgew LIKE vekp-brgew,
            l_ntgew LIKE vekp-ntgew,
    *        l_tavol LIKE vekp-tavol.
            l_tavol TYPE p DECIMALS 5.
      t_disp1[] = t_disp[].
      SORT t_disp1 BY vbeln matnr vhilm.
      SORT t_disp BY vbeln venum matnr vhilm.  "CN1 inserted by yongchun
      DELETE ADJACENT DUPLICATES FROM t_disp1 COMPARING vbeln matnr vhilm.
      LOOP AT t_disp1.
        LOOP AT t_disp WHERE vbeln = t_disp1-vbeln
                       AND   matnr = t_disp1-matnr
                       AND   vhilm = t_disp1-vhilm.
    *CN1 removed start by yongchun
    *      l_ctnno = l_ctnno + 1.
    *      l_vemng = l_vemng + t_disp-vemng.
    *      l_brgew = l_brgew + t_disp-brgew.
    *      l_ntgew = l_ntgew + t_disp-ntgew.
    *      l_tavol = l_tavol + t_disp-tavol.
    *CN1 removed end
    *CN1 insert start by yongchun
          AT NEW venum.
            READ TABLE t_disp INDEX sy-tabix.
            l_ctnno = l_ctnno + 1.
            l_brgew = l_brgew + t_disp-brgew.
            l_ntgew = l_ntgew + t_disp-ntgew.
            l_tavol = l_tavol + t_disp-tavol.
          ENDAT.
          l_vemng = l_vemng + t_disp-vemng.
    *CN1 insert end
        ENDLOOP.
        MOVE l_ctnno TO t_disp1-ctnno.
        MOVE l_vemng TO t_disp1-vemng.
        MOVE l_brgew TO t_disp1-brgew.
        MOVE l_ntgew TO t_disp1-ntgew.
        MOVE l_tavol TO t_disp1-tavol.
        MODIFY t_disp1.
        CLEAR: l_ctnno, l_vemng, l_brgew,
               l_ntgew, l_tavol, t_disp1.
      ENDLOOP.
    ENDFORM.                    "get_disp_data
    *       FORM refresh_Data                                             *
    FORM refresh_data.
      CLEAR: t_itab, t_itab1, t_disp.
      REFRESH: t_itab, t_itab1, t_disp.
    ENDFORM.                    "refresh_data
    *       FORM display_rep                                              *
    FORM display_rep.
      DATA:
        chrctnno(12) TYPE c,
        chrihrez(12) TYPE c,
        chrvemng(13) TYPE c,
        chrbrgew(18) TYPE c,
        chrntgew(18) TYPE c,
        chrtavol(18) TYPE c,
        chrmatnr(40) TYPE c,
    *--> Start insert "CN6
        chrkunnr(10) TYPE c,
    *<-- End insert "CN6
        chrzuonr LIKE vbrk-zuonr,
    *  CN3 start insert
          t_index LIKE sy-tabix.
    *  CN3 end insert
    *  SORT t_disp1 BY name1 vbeln fkdat.
    *CN1 start change by yongchun
    *  SORT t_disp1 BY name1 fkdat vbeln ihrez .
    *-->CN5
    *Note: report already sorted by name1 (changed to ship-to-party)
    *<--CN5
      SORT t_disp1 BY name1 ihrez fkdat vbeln venum .
    *CN1 end change by yongchun
      LOOP AT t_disp1.
    *  CN3 start insert
        t_index = sy-tabix.
    *  CN3 end insert
        chrctnno = t_disp1-ctnno.
        chrzuonr = t_disp1-zuonr.
        chrihrez = t_disp1-ihrez.
        chrvemng = t_disp1-vemng.
        chrbrgew = t_disp1-brgew.
        chrntgew = t_disp1-ntgew.
        chrtavol = t_disp1-tavol.
    *--> Start insert "CN6
        chrkunnr = t_disp1-kunnr.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
          EXPORTING
            input     = chrkunnr
          IMPORTING
            output    = chrkunnr.
    *<-- End insert "CN6
        CONDENSE: t_disp1-desctn, chrbrgew, chrntgew, chrtavol, chrvemng, chrctnno.
    *   Format material number
    *start delete CN4
    *    PERFORM GetLongMatnr USING t_disp1-matnr
    *                      CHANGING chrMatnr.
    * end delete CN4
    * start insert CN4
        PERFORM getlongmatnr USING t_disp1-matnr t_disp1-matwa
                        CHANGING chrmatnr.
        PERFORM date_format.
        AT NEW name1.
          NEW-PAGE.
          WRITE: /2 t_disp1-name1, 40 chrkunnr.       "CN6
        ENDAT.
        AT NEW vbeln.
          CONDENSE t_disp1-vbeln NO-GAPS.
          CONDENSE chrzuonr NO-GAPS.
          WRITE: /4 t_disp1-vbeln, '/', chrzuonr, 59 g_date, 76 chrihrez.    "CN6
        ENDAT.
    *    WRITE: /10(20) t_disp1-maktx,
    *            35(20) t_disp1-bstkd,
    *            55(15) t_disp1-vemng,
    *            75(10) t_disp1-ctnno,
    *            90(30) t_disp1-desctn,
    *            120(18) t_disp1-brgew,
    *            140(18) t_disp1-ntgew,
    *            160(18) t_disp1-tavol.
    *           /10(12) t_disp1-ihrez,
    *CN1 change start by yongchun
        WRITE:/5(40) chrmatnr,
              45(20) t_disp1-bstkd,
              65(15) chrvemng.
        AT NEW venum.
    *  CN3 start delete
    *      READ TABLE t_disp1 INDEX sy-tabix.
    *  CN3 end delete
    *   CN3 start insert
          READ TABLE t_disp1 INDEX t_index.
    *   CN3 end insert
          WRITE: 80(5) chrctnno,
                 85(25) t_disp1-desctn,
                 120(10) chrbrgew,
                 130(10) chrntgew,
                 140(18) chrtavol.
        ENDAT.
    *CN1 change end
        PERFORM sub_total.
        AT END OF vbeln.
          PERFORM grand_total.
          PERFORM write_sub_total.
        ENDAT.
        AT END OF name1.
          PERFORM write_grand_total.
        ENDAT.
      ENDLOOP.
    ENDFORM.                    "display_rep
    *       FORM date_format                                              *
    FORM date_format.
      CLEAR g_date.
      CONCATENATE t_disp1-fkdat+6(2)
                  t_disp1-fkdat+4(2)
                  t_disp1-fkdat(4) INTO g_date SEPARATED BY '.'.
    ENDFORM.                    "date_format
    *       FORM SUB_TOTAL                                                *
    FORM sub_total.
      g_tot_vemng = g_tot_vemng + t_disp1-vemng.
      g_tot_ctnno = g_tot_ctnno + t_disp1-ctnno.
      g_tot_brgew = g_tot_brgew + t_disp1-brgew.
      g_tot_ntgew = g_tot_ntgew + t_disp1-ntgew.
      g_tot_tavol = g_tot_tavol + t_disp1-tavol.
    ENDFORM.                    "sub_total
    *       FORM write_sub_total                                          *
    FORM write_sub_total.
      DATA:
        chrvemng(18) TYPE c,
        chrctnno(18) TYPE c,
        chrbrgew(18) TYPE c,
        chrntgew(18) TYPE c,
        chrtavol(18) TYPE c.
      chrvemng = g_tot_vemng.
      chrctnno = g_tot_ctnno.
      chrbrgew = g_tot_brgew.
      chrntgew = g_tot_ntgew.
      chrtavol = g_tot_tavol.
      CONDENSE: chrbrgew, chrntgew, chrtavol, chrvemng, chrctnno.
    *  WRITE: /15 sy-uline(200),
    *         /10 'TOTAL',
    *          55(15) g_tot_vemng,
    *          75(10) g_tot_ctnno,
    *         120(18) g_tot_brgew,
    *         140(18) g_tot_ntgew,
    *         160(18) g_tot_tavol,
      WRITE: /11 sy-uline(200),
          /5 'TOTAL',
           65(15) chrvemng,
           80(10) chrctnno,
          120(18) chrbrgew,
          130(18) chrntgew,
          140(18) chrtavol,
          /11 sy-uline(200).
      CLEAR: g_tot_vemng, g_tot_ctnno, g_tot_brgew,
             g_tot_ntgew, g_tot_tavol.
    ENDFORM.                    "write_sub_total
    *       FORM GRAND_TOTAL                                              *
    FORM grand_total.
      g_gtot_vemng = g_gtot_vemng + g_tot_vemng.
      g_gtot_ctnno = g_gtot_ctnno + g_tot_ctnno.
      g_gtot_brgew = g_gtot_brgew + g_tot_brgew.
      g_gtot_ntgew = g_gtot_ntgew + g_tot_ntgew.
      g_gtot_tavol = g_gtot_tavol + g_tot_tavol.
    ENDFORM.                    "grand_total
    *       FORM WRITE_GRAND_TOTAL                                        *
    FORM write_grand_total.
      DATA:
        chrvemng(18) TYPE c,
        chrctnno(18) TYPE c,
        chrbrgew(18) TYPE c,
        chrntgew(18) TYPE c,
        chrtavol(18) TYPE c.
      chrvemng = g_gtot_vemng.
      chrctnno = g_gtot_ctnno.
      chrbrgew = g_gtot_brgew.
      chrntgew = g_gtot_ntgew.
      chrtavol = g_gtot_tavol.
      CONDENSE: chrbrgew, chrntgew, chrtavol, chrvemng, chrctnno.
      SKIP.
    *  WRITE: /10 'GRAND TOTAL',
    *          55(15) g_gtot_vemng,
    *          75(10) g_gtot_ctnno,
    *         120(18) g_gtot_brgew,
    *         140(18) g_gtot_ntgew,
    *         160(18) g_gtot_tavol,
      WRITE: /5 'GRAND TOTAL',
              65(15) chrvemng,
              80(10) chrctnno,
             120(18) chrbrgew,
             130(18) chrntgew,
             140(18) chrtavol,
             /11 sy-uline(200).
      CLEAR: g_gtot_vemng, g_gtot_ctnno, g_gtot_brgew,
             g_gtot_ntgew, g_gtot_tavol.
    ENDFORM.                    "write_grand_total
    *       top_of_page                                                   *
    TOP-OF-PAGE.
      PERFORM sub_top_of_page.
      PERFORM column_header.
    *       FORM sub_top_of_page                                          *
    FORM sub_top_of_page.
      IF date-high IS INITIAL.
        date-high = date-low.
      ENDIF.
      SKIP.
      WRITE :/45 'JOHN WHILE SPRINGS (S) PTE. LTD.',
              130 'Page', 135 sy-pagno, 170 '',
             /45 'Packing List Report',
             /45 'Invoice Date FROM ', date-low , '-', date-high,
             130 'Date:', 135 sy-datum, 170 ''.
      ULINE.
    ENDFORM.                    "sub_top_of_page
    *       FORM column_header                                            *
    FORM column_header.
    *--> Start insert "CN6
      DATA: l_party(13) TYPE c.
      IF sold = 'X'.
        l_party = 'Sold To Party'.
      ELSEIF ship = 'X'.
        l_party = 'Ship To Party'.
      ENDIF.
    *<-- End insert "CN6
      WRITE: /4  'Invoice / DO Number', 40 l_party, 59 'Invoice Date', 76 'Buyer Code',     "CN6
    *         /10 'Part ID/Rev',
    *          35 'PO No.',
    *          65 'Qty',
    *          75 'Carton No.',
    *          95 'Carton Size',
    *          125 'Gross Wt(KG)',
    *          147 'Net Wt(KG)',
    *          167 'Volume(M3)'.
    *           /10 'Buyer Code',
                /5 'Part ID/Rev',
                 45 'PO No.',
                 65 'Qty',
                 72 'Carton No.',
                 85 'Carton Size',
                114 'Gross Wt(KG)',
                127 'Net Wt(KG)',
                138 'Volume(M3)'.
      ULINE.
    ENDFORM.                    "column_header
    *      Form  Convert_Volume
    FORM convert_volume  USING    l_itab1_vhilm
                         CHANGING l_itab1_tavol.
      DATA: unit_1 LIKE t006-msehi,
            unit_2 LIKE t006-msehi VALUE 'M3',
            var1 TYPE f,
            var2 TYPE f,
            var3 TYPE f,
            var4 LIKE t006-andec VALUE 3,
            l_volum TYPE p DECIMALS 5,
            dimid  LIKE t006-dimid VALUE 'VOLUME',
            l_voleh LIKE t006-msehi.
      SELECT SINGLE voleh FROM mara INTO l_voleh
             WHERE matnr = l_itab1_vhilm.
      IF sy-subrc = 0.
        unit_1 = l_voleh.
        CALL FUNCTION 'CONVERSION_FACTOR_GET'
          EXPORTING
            no_type_check        = ' '
            unit_in              = unit_1
            unit_out             = unit_2
          IMPORTING
            add_const            = var1
            denominator          = var2
            numerator            = var3
            decimals             = var4
            dimension            = dimid
          EXCEPTIONS
            conversion_not_found = 1
            overflow             = 2
            type_invalid         = 3
            units_missing        = 4
            unit_in_not_found    = 5
            unit_out_not_found   = 6
            OTHERS               = 7.
        IF sy-subrc = 0.
          l_volum =  l_itab1_tavol  * ( var3 / var2 ) + var1.
          l_itab1_tavol = l_volum.
        ENDIF.
      ENDIF.
    ENDFORM.                    " Convert_Volume
    *start delete CN4
    *FORM GetLongMatnr USING shortMatnr CHANGING longMatnr.
    *DATA:
    *  intLength TYPE i,
    *  rowMARA LIKE MARA.
    *  CALL FUNCTION 'CONVERSION_EXIT_MATN2_OUTPUT'
    *    EXPORTING
    *      INPUT         = shortMatnr
    *    IMPORTING
    *      OUTPUT        = longMatnr.
    ** Format the material number
    ** Get the material type
    *  SELECT SINGLE *
    *    INTO rowMARA
    *    FROM MARA
    *   WHERE matnr = shortMatnr.
    *   intLength = strlen( longMatnr ).
    **  Remove prefix.
    *   IF rowMARA-mtart = 'ZFPT' OR rowMARA-mtart = 'ZMFG' OR rowMARA-mtart = 'ZSEC' OR
    *      rowMARA-mtart = 'ZTOL' OR rowMARA-mtart = 'ZTRD'.
    *      intLength = intLength - 2.
    **     Remove 1st 2 characters of prefix
    *      longMatnr = longMatnr+2(intLength).
    **   ELSEIF rowMARA-mtart = 'ZRAW'.
    ***     Remove prefix - 1st 2 characters.
    **      intLength = intLength - 2.
    **      longMatnr = longMatnr+2(intLength).
    ***     Remove last 4 digits
    **      intLength = intLength - 4.
    **      longMatnr = longMatnr+0(intLength).
    *   ENDIF.
    *ENDFORM.
    *end delete CN4
    *start insert CN4
    FORM getlongmatnr USING shortmatnr tmp_matwa CHANGING longmatnr.
      DATA:
        intlength TYPE i,
        rowmara LIKE mara.
      IF shortmatnr = tmp_matwa.
        CALL FUNCTION 'CONVERSION_EXIT_MATN2_OUTPUT'
          EXPORTING
            input  = shortmatnr
          IMPORTING
            output = longmatnr.
    * Format the material number
    * Get the material type
        SELECT SINGLE *
          INTO rowmara
          FROM mara
         WHERE matnr = shortmatnr.
        intlength = STRLEN( longmatnr ).
    *  Remove prefix.
        IF rowmara-mtart = 'ZFPT' OR rowmara-mtart = 'ZMFG' OR rowmara-mtart = 'ZSEC' OR
           rowmara-mtart = 'ZTOL' OR rowmara-mtart = 'ZTRD'.
          intlength = intlength - 2.
    *     Remove 1st 2 characters of prefix
          longmatnr = longmatnr+2(intlength).
        ENDIF.
      ELSE.
    *  if material entered is different
        longmatnr = tmp_matwa.
        CALL FUNCTION 'CONVERSION_EXIT_MATN2_OUTPUT'
          EXPORTING
            input  = longmatnr
          IMPORTING
            output = longmatnr.
      ENDIF.
    ENDFORM.                    "GetLongMatnr
    *end insert CN4

    But when I executed above sql query I got some of the users also listed in the output who were not using TFS and also some service accounts.
    Could you please confirm why this is happening.

  • Need Help with the Total and Grand Total

    Hi All,
    I have posted a question couple of days ago regarding the COUNT and AVERAGES, for a minute i thought i got the work around, but the problem still exists. I'm trying to find the average work done and average revenue generated. I have to do this by the location,
    employee id , date and the number of hours. Below is a sample for february 2014. I have two averages for the work done AvgWorkDone=(sum of work done/count of workingdays in month), the second one is AverageWorkDone1... which i skewed by multiplying by 16 (since
    there are 16 hours in my data per day) Please need help
    Year Name
    Calendar 2014
    Month Of Year Name
    Month 2
    Row Labels
    workdone
    STG WORKDONE VW Count
    AvgRev
    AvgWorkdone
    AvgWorkdone1
    1
    2433.333333
    368
    1.591304348
    6.612318841
    105.7971014
    1368
    2433.333333
    368
    1.591304348
    6.612318841
    105.7971014
    10AM
    0
    23
    0
    0
    0
    11AM
    23.33333333
    23
    0
    1.014492754
    16.23188406
    12PM
    91.66666667
    23
    0
    3.985507246
    63.76811594
    1PM
    58.33333333
    23
    0
    2.536231884
    40.57971014
    2PM
    41.66666667
    23
    0
    1.811594203
    28.98550725
    3PM
    161.6666667
    23
    0
    7.028985507
    112.4637681
    4PM
    176.6666667
    23
    0
    7.68115942
    122.8985507
    5AM
    0
    23
    25.46086957
    0
    0
    5PM
    191.6666667
    23
    0
    8.333333333
    133.3333333
    6AM
    0
    23
    0
    0
    0
    6PM
    450
    23
    0
    19.56521739
    313.0434783
    7AM
    0
    23
    0
    0
    0
    7PM
    618.3333333
    23
    0
    26.88405797
    430.1449275
    8AM
    0
    23
    0
    0
    0
    8PM
    620
    23
    0
    26.95652174
    431.3043478
    9AM
    0
    23
    0
    0
    0
    Grand Total
    2433.333333
    368
    1.591304348
    6.612318841
    105.7971014
    If you see the above report the number of days are adding upto 368, this causes the Individual Averages to be fine but the GrandToatl of the Average is messed up. If i multiply by 16 the Individual Averages are messed up, but the GrandAverage is coming RIGHT.
    Please need help where i can get both the individual and the grand averages right.
    SV

    Hi All,
    Finally i found a solution. a) I have a time dim from the ware house and its joined to the fact table based on the dateid, since the fact table is getting only the data for the working days , the ware house time dim is showing only those days as count.
    b) I created a new time dim in SSAS TIMEDIMSSAS
    c) I joined the new TIMEDIMSSAS to the warehouse time dimension and the fact table and created new measure AvgWorkDone over time and Avg Rev over time.
    I'm getting what i wanted. BUT here is a new problem , when i select multiple months the grand total (which should be Average is showing wrong average and i'm not sure why), can anyone please help ?
    Row Labels
    AvgRevenue
    AvgWorkDone
    1
    $4.17
    277.6801802
    1368
    $4.17
    277.6801802
    February 2014
    $1.59
    105.7971014
    January 2014
    $0.97
    64.66666667
    March 2014
    $9.52
    634.5512821
    Grand Total
    $4.17
    277.6801802
    The values were supposed to be (1.59+.97+9.52)/3=4.02 and NOT 4.17 for Revenue. Similarly for WorkDone (105.79+64.66+634.55)/3=268.33 and NOT 277.68
    Please can some one suggest what is going wrong here?
    Thanks
    SV

  • Need help with "percentage of" I need to see grandparent totals

    Theres a division in my database between Supervisors, Representants, and Lines.
    The hierarchy is Supervisors -> Representants -> Lines
    I have a measure called "acum sold" and I need the percentage of it.
    I`m using "Percentage of" -> "Collumn"and it works untill I reach the Lines level, then it doesn`t work (well it does, but not in the way I want)
    Basically it`s this
    Supervisor----Acum Sold---% Acum Sold
    X-------------1000------------100%----
    Then I go to the next level
    Supervisor----Representant----Acum Sold---% Acum Sold
    -----X----------------XY------------------500---------------50%-----
    -----X----------------YZ------------------500---------------50%-----
    And it`s still the way I want, but when I drill to XY representant...
    Supervisor----Representant----Lines-------Acum Sold---% Acum Sold
    -----X----------------XY------------XY1---------100---------------20%-----
    -----X----------------XY------------XY2---------400---------------80%-----
    The percentage is based off the XY totals (percentage of the 500 total acum sold) but I actually need the percentage based on the Supervisor
    I need something like this
    Supervisor----Representant----Lines-------Acum Sold---% Acum Sold
    -----X----------------XY------------XY1---------100---------------10%-----
    -----X----------------XY------------XY2---------400---------------40%-----
    Because XY1 and XY2 sold only 50% of the supervisor`s total. But BIEE is always trying to get 100% of the parent level, instead of the "grandparent" one.
    I hope I didn`t sound that confusing, I really need help with this one.
    Thanks in advance

    You need to use level based measures. Look up documentation/this forum for Level based measures (LBM).
    In short you drag a fact meaure to a heirarchy level in business mapping layer and it will always aggreagtre to that level. So create a total and grandparent level then divide child sum by grandparent total (LBM)

  • Help with a resetting running total

    Hi, I need help with a query that will have a running total that resets at certain points
    Version
    BANNER                                                                        
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production    
    PL/SQL Release 11.2.0.3.0 - Production                                          
    CORE  11.2.0.3.0  Production                                                        
    TNS for Linux: Version 11.2.0.3.0 - Production                                  
    NLSRTL Version 11.2.0.3.0 - Production sample data
    create table t ( stat varchar2(3)
                   , beg_dt date
                   , end_dt date
                   , dur    number);
    Insert into t  values ('ACT',to_date('01-JUL-2012','DD-MON-YYYY'),to_date('31-JUL-2012','DD-MON-YYYY'),31);
    Insert into t  values ('ACT',to_date('01-AUG-2012','DD-MON-YYYY'),to_date('31-AUG-2012','DD-MON-YYYY'),31);
    Insert into t  values ('ACT',to_date('01-SEP-2012','DD-MON-YYYY'),to_date('30-SEP-2012','DD-MON-YYYY'),30);
    Insert into t  values ('LOA',to_date('01-OCT-2012','DD-MON-YYYY'),to_date('25-OCT-2012','DD-MON-YYYY'),25);
    Insert into t  values ('LOA',to_date('26-OCT-2012','DD-MON-YYYY'),to_date('31-OCT-2012','DD-MON-YYYY'),6);
    Insert into t  values ('LOA',to_date('01-NOV-2012','DD-MON-YYYY'),to_date('04-NOV-2012','DD-MON-YYYY'),4);
    Insert into t  values ('ACT',to_date('05-NOV-2012','DD-MON-YYYY'),to_date('10-NOV-2012','DD-MON-YYYY'),6);
    Insert into t  values ('LOA',to_date('11-NOV-2012','DD-MON-YYYY'),to_date('30-NOV-2012','DD-MON-YYYY'),20);
    Insert into t  values ('LOA',to_date('01-DEC-2012','DD-MON-YYYY'),to_date('15-DEC-2012','DD-MON-YYYY'),15);
    Insert into t  values ('ACT',to_date('16-DEC-2012','DD-MON-YYYY'),to_date('31-DEC-2012','DD-MON-YYYY'),16);
    Insert into t  values ('LOA',to_date('01-JAN-2013','DD-MON-YYYY'),to_date('31-JAN-2013','DD-MON-YYYY'),31);
    Insert into t  values ('LOA',to_date('01-FEB-2013','DD-MON-YYYY'),to_date('05-FEB-2013','DD-MON-YYYY'),5);
    Insert into t  values ('LOA',to_date('06-FEB-2013','DD-MON-YYYY'),to_date('15-FEB-2013','DD-MON-YYYY'),10);
    Insert into t  values ('LOA',to_date('16-FEB-2013','DD-MON-YYYY'),to_date('25-FEB-2013','DD-MON-YYYY'),10);
    Insert into t  values ('LOA',to_date('26-FEB-2013','DD-MON-YYYY'),to_date('28-FEB-2013','DD-MON-YYYY'),3);
    Insert into t  values ('LOA',to_date('01-MAR-2013','DD-MON-YYYY'),to_date('10-MAR-2013','DD-MON-YYYY'),10);
    Insert into t  values ('ACT',to_date('11-MAR-2013','DD-MON-YYYY'),to_date('31-MAR-2013','DD-MON-YYYY'),21);
    Insert into t  values ('ACT',to_date('01-APR-2013','DD-MON-YYYY'),to_date('30-APR-2013','DD-MON-YYYY'),30);
    Insert into t  values ('LOA',to_date('01-MAY-2013','DD-MON-YYYY'),to_date('25-MAY-2013','DD-MON-YYYY'),25);
    Insert into t  values ('LOA',to_date('26-MAY-2013','DD-MON-YYYY'),to_date('31-MAY-2013','DD-MON-YYYY'),6);
    Insert into t  values ('LOA',to_date('01-JUN-2013','DD-MON-YYYY'),to_date('04-JUN-2013','DD-MON-YYYY'),4);
    Insert into t  values ('ACT',to_date('05-JUN-2013','DD-MON-YYYY'),to_date('30-JUN-2013','DD-MON-YYYY'),26);This is close.
    select stat
        , beg_dt
        , end_dt                            
        , dur
        , sum( case stat when 'LOA' then dur else 0 end ) over ( partition by stat order by beg_dt) tot1
    from t
    order by beg_dt
    STAT BEG_DT      END_DT      DUR TOT1
    ACT  01-JUL-2012 31-JUL-2012  31    0
    ACT  01-AUG-2012 31-AUG-2012  31    0
    ACT  01-SEP-2012 30-SEP-2012  30    0
    LOA  01-OCT-2012 25-OCT-2012  25   25
    LOA  26-OCT-2012 31-OCT-2012   6   31
    LOA  01-NOV-2012 04-NOV-2012   4   35
    ACT  05-NOV-2012 10-NOV-2012   6    0
    LOA  11-NOV-2012 30-NOV-2012  20   55
    LOA  01-DEC-2012 15-DEC-2012  15   70
    ACT  16-DEC-2012 31-DEC-2012  16    0
    LOA  01-JAN-2013 31-JAN-2013  31  101
    LOA  01-FEB-2013 05-FEB-2013   5  106
    LOA  06-FEB-2013 15-FEB-2013  10  116
    LOA  16-FEB-2013 25-FEB-2013  10  126
    LOA  26-FEB-2013 28-FEB-2013   3  129
    LOA  01-MAR-2013 10-MAR-2013  10  139
    ACT  11-MAR-2013 31-MAR-2013  21    0
    ACT  01-APR-2013 30-APR-2013  30    0
    LOA  01-MAY-2013 25-MAY-2013  25  164
    LOA  26-MAY-2013 31-MAY-2013   6  170
    LOA  01-JUN-2013 04-JUN-2013   4  174
    ACT  05-JUN-2013 30-JUN-2013  26    0 I need a running total of LOA stat that will reset itself with each break of ACT so that I get :
    STAT BEG_DT      END_DT      DUR TOT1
    ACT  01-JUL-2012 31-JUL-2012  31    0
    ACT  01-AUG-2012 31-AUG-2012  31    0
    ACT  01-SEP-2012 30-SEP-2012  30    0
    LOA  01-OCT-2012 25-OCT-2012  25   25
    LOA  26-OCT-2012 31-OCT-2012   6   31
    LOA  01-NOV-2012 04-NOV-2012   4   35
    ACT  05-NOV-2012 10-NOV-2012   6    0
    LOA  11-NOV-2012 30-NOV-2012  20   20
    LOA  01-DEC-2012 15-DEC-2012  15   35
    ACT  16-DEC-2012 31-DEC-2012  16    0
    LOA  01-JAN-2013 31-JAN-2013  31   31
    LOA  01-FEB-2013 05-FEB-2013   5   36
    LOA  06-FEB-2013 15-FEB-2013  10   46
    LOA  16-FEB-2013 25-FEB-2013  10   56
    LOA  26-FEB-2013 28-FEB-2013   3   59
    LOA  01-MAR-2013 10-MAR-2013  10   69
    ACT  11-MAR-2013 31-MAR-2013  21    0
    ACT  01-APR-2013 30-APR-2013  30    0
    LOA  01-MAY-2013 25-MAY-2013  25   25
    LOA  26-MAY-2013 31-MAY-2013   6   31
    LOA  01-JUN-2013 04-JUN-2013   4   35
    ACT  05-JUN-2013 30-JUN-2013  26    0 Any help would be appreciated, thanks.

    Hi,
    So, you want a separate total whenever there's an 'ACT'. That's what PARTITION BY is for. You need to add the number of ACTs already encountered (which I called act_cnt) to the PARTITION BY clause that gets you the SUM.
    We can get act_cnt using the analytic functions like COUNT or SUM, but, since one analytic function can't depend on another computed inthe same query, we need to use a sub-query to compute act_cnt.
    Here's one way:
    WITH     got_act_cnt     AS
         SELECT     stat, beg_dt, end_dt, dur
         ,     COUNT (CASE WHEN stat = 'ACT' THEN 1 END)
                  OVER (ORDER BY  beg_dt)   AS act_cnt
         FROM    t
    SELECT       stat, beg_dt, end_dt, dur
    ,       SUM (CASE stat WHEN 'LOA' THEN dur ELSE 0 END)
             OVER ( PARTITION BY  stat
                     ,                act_cnt     -- ***** NEW *****
                 ORDER BY      beg_dt
               )       AS totl
    FROM      got_act_cnt
    ORDER BY  beg_dt
    ;Are 'ACT' and 'LOA' the only possible values for stat? If so, the query above can probably be simplified.

  • Creation of context sensitive help with pure FM 12 usage doesn't work

    Hi,
    I hope somebody is able to help me with a good hint or tip.
    I am trying to create a context-sensitive Microsoft Help with FM12 only using the abilities of FM (no RoboHelp). For some reasons, my assigned ID's are not used in the generated chm file and therefore the help does not work context-sensitively.
    What did I do?
    - I created my FM files and assigned topic aliases to the headers. I did this two ways: a) using the "Special" menue and assigning a CSH marker and/or b) setting a new marker of type "Topic Alias" and typing the ID. I used only numeric IDs like "2000" or "4200",
    - I created a .h file (projectname.h) - based on the format of the file projectname_!Generated!.h (I read this in some instructions). So the .h file (text file) looks like this:
    #define 2000 2000 /* 4 Anwendungsoberfläche */
    #define 2022 2022 /* 4.1.1 Menü Datei */
    #define 2030 2030 /* 4.1.3 Menü Parametersatz */
    #define 2180 2180 /* 6.6.7 Objektdialog Q-Regler */
    #define 2354 2354 /* 6.9.2 Objektdialog Extran Parameter */
    #define 2560 2560 /* 6.9.5 Objektdialog Extran2D Parametersatz */
    - I published the Microsoft HTML Help. A projectname_!Generated!.h has been created. My IDs were not used in this file:
    #define 2000    1
    #define 2022    2
    #define 2030    3
    #define 2180    4
    #define 2354    5
    #define 2560    6
    - When I open the .chm file and look in the source code, the ID even is totally different. It is not the one, I assigned in FM, it is not the one which I assigned in the projectname.h file and it even is not the one, which was put in the projectname_!Generated!.h file. It is a generated name starting with CSH_1 ...n in a consecutive way numbered.
    Example:
    <p class="FM_Heading1"><a name="XREF_72066_13_Glossar"></a>Gloss<a name="CSH_1"></a>ar</p>
    What goes wrong? Why does FM not take my assigned IDs? I need to use these IDs since our programmers are using those already - I had to re-create the whole online help but the programs stay untouched.
    Please help!
    Many thanks
    Mohi

    Hi Jeff,
    thanks for your note!
    The text in my marker is just a number like "2000" or "4200". As said, I created manually a my.h file and used this marker there. E.g.
    #define 2000 2000.
    Whereby the first 2000 (in my opinion) is the marker text and the second 2000 is the context ID which the programmers are using for the context sensitive call of the help. My definitions in the my.h file were translated to #define 2000 1 (in the my_!Generated!.h file). The source code "translates" the context ID into CSH_8.
    I am still confused :-/
    Thanks
    Mohi

  • Query help with Model clause

    Hi Gurus,
    Can someone please help me out.
    I've a below tables.
    1) tbl_link --> this table contains information at profile level
    2) tbl_summary --> this table contains summary at parent profile level derived from tbl_link table
    One parent profile contains multiple child profiles and each child profile links to a code (which is B, W, G or P) and the code is linked to a category (i.e. ONL and OFL). In this case code B is linked to category 'ONL' and codes W,G,P linked to OFL category.
    ONL category needs 100 points. If it don't have enough points then i need to borrow from OFL category which i'm doing and populating into tbl_summary table at parent profile level.
    Now i need to insert data into tbl_link table at profile level with howmany points used, expired based on tbl_summary table. Rule is at the end of month if we add points for each profile in tbl_link table it should come as 0.
    with
    tbl_SUMMARY as
    select 1 as ppid,'ONL' as catgcode, 53 as earned_points,47 BORROWED_POINTS,100 CERT_POINTS,0 DISCARD_POINTS,100 used from dual
    union
    select 1 as ppid,'OFL' as catgcode, 223 as earned_points,0 BORROWED_POINTS,176 CERT_POINTS,76 DISCARD_POINTS,100 used from dual
    union
    select 2 as ppid,'ONL' as catgcode, 39 as earned_points,61 BORROWED_POINTS,100 CERT_POINTS,0 DISCARD_POINTS,100 used from dual
    union
    select 2 as ppid,'OFL' as catgcode, 90 as earned_points,0 BORROWED_POINTS,29 CERT_POINTS,29 DISCARD_POINTS,100 used from dual
    union
    select 3 as ppid,'ONL' as catgcode, 109 as earned_points,0 BORROWED_POINTS,109 CERT_POINTS,9 DISCARD_POINTS,100 used from dual
    union
    select 3 as ppid,'OFL' as catgcode, 223 as earned_points,0 BORROWED_POINTS,223 CERT_POINTS,23 DISCARD_POINTS,200 used from dual
    union
    select 4 as ppid,'ONL' as catgcode, 109 as earned_points,0 BORROWED_POINTS,109 CERT_POINTS,9 DISCARD_POINTS,100 used from dual
    union
    select 4 as ppid,'OFL' as catgcode, 169 as earned_points,0 BORROWED_POINTS,169 CERT_POINTS,69 DISCARD_POINTS,100 used from dual
    tbl_link as
    select 1 as ppid,1 as pid, 'B' as code,'ONL' as catgcode, 53 as earned_points from dual
    union
    select 1 as ppid,12 as pid, 'W' as code,'OFL' as catgcode, 26 as earned_points from dual
    union
    select 1 as ppid,13 as pid, 'G' as code,'OFL' as catgcode, 87 as earned_points from dual
    union
    select 1 as ppid,14 as pid, 'P' as code,'OFL' as catgcode, 110 as earned_points from dual
    union
    select 2 as ppid,2 as pid, 'B' as code,'ONL' as catgcode, 39 as earned_points from dual
    union
    select 2 as ppid,22 as pid, 'W' ,'OFL' as catgcode, 30 as earned_points from dual
    union
    select 2 as ppid,23 as pid, 'G' ,'OFL' as catgcode, 29 as earned_points from dual
    union
    select 2 as ppid,24 as pid, 'P' ,'OFL' as catgcode, 31 as earned_points from dual
    union
    select 3 as ppid,3 as pid, 'B' as code,'ONL' as tier_catgcode, 109 as earned_points from dual
    union
    select 3 as ppid,32 as pid, 'W' ,'OFL' , 26 as earned_points from dual
    union
    select 3 as ppid,33 as pid, 'G' ,'OFL', 87 as earned_points from dual
    union
    select 3 as ppid,34 as pid, 'P' ,'OFL' , 110 as earned_points from dual
    union
    select 4 as ppid,4 as pid, 'B' as code,'ONL' as catgcode, 109 as earned_points from dual
    union
    select 4 as ppid,42 as pid, 'W' as code,'OFL' , 26 as earned_points from dual
    union
    select 4 as ppid,43 as pid, 'G' as code,'OFL' , 87 as earned_points from dual
    union
    select 4 as ppid,44 as pid, 'P' as code,'OFL' , 56 as earned_points from dual
    final (PARENT_PROFILE_ID,PROFILE_ID,catgcode,EARNED_POINTS,BORROWED_POINTS,CERT_POINTS,DISCARD_POINTS,USED)
    as (
    select A.PPID PARENT_PROFILE_ID,B.PID PROFILE_ID,A.catgcode,B.EARNED_POINTS,BORROWED_POINTS,CERT_POINTS,DISCARD_POINTS,USED
    from tbl_SUMMARY a,tbl_link b where a.ppid=b.ppid AND A.catgcode=B.catgcode
    ORDER BY PROFILE_ID
    select * from final order by 1;
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED
    1                  1           ONL       53             47               100          0               100
    1                  14          OFL       110            0                176          76              100
    1                  13          OFL       87             0                176          76              100
    1                  12          OFL       26             0                176          76              100
    2                  2           ONL       39             61               100          0               100
    2                  24          OFL       31             0                29           29              100
    2                  23          OFL       29             0                29           29              100
    2                  22          OFL       30             0                29           29              100
    3                  32          OFL       26             0                223          23              200
    3                  33          OFL       87             0                223          23              200
    3                  34          OFL       110            0                223          23              200
    3                  3           ONL       109            0                109          9               100
    4                  42          OFL       26             0                169          69              100
    4                  43          OFL       87             0                169          69              100
    4                  44          OFL       56             0                169          69              100
    4                  4           ONL       109            0                109          9               100
    Need Output as below :
    For parent profile 1, whatever i mentioned above is not correct. Borrowed 47 points from OFL to ONL to make ONL and also from OFL category has 176 points remaining after lending to ONL and using only 100 points, remaining 76 points are discarded. Need to deduct these 76 points also from child profiles. Output will be as below.
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    1                  1           ONL       53             47               100          0               100   -53       0
    1                  12          OFL       26             0                176          76              100   -26       0
    1                  13          OFL       87             0                176          76              100   -74       -13
    1                  14          OFL       110            0                176          76              100   -47       -63
    For parent profile id 2 --> ONL category has 39 points, so borrowed 61 points from OFL category to make ONL points 100.
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 22,23,24).
    Borrowed 61 points from OFL and need to deduct this points from the profile which has highest earned points, in this case deduct from profile 24 which has 31 points, from profile 22 which has 30 points. Need output like below
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    2                  2           ONL       39             61               100          0               100   -39       0
    2                  22          OFL       30             0                29           29              100   -30       0
    2                  23          OFL       29             0                29           29              100   0         -29
    2                  24          OFL       31             0                29           29              100   -31       0
    For parent profile id 3 --> ONL category has 109 points, so no need to borrow points from OFL category
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 32,33,34).
    in this case ONL has 100 points, so move the remaining 9 points will be expired. OFL category has 223 points total. need only 200 points (i.e. mutiple of 100) for our process, 23 points will be expired and has to deduct from the profile which has highest earned points, in this case from profile 34. Output :
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    3                  3           ONL       109            0                109          9               100   -100      -9
    3                  32          OFL       26             0                223          23              200   -26       0
    3                  33          OFL       87             0                223          23              200   -87       0
    3                  34          OFL       110            0                223          23              200   -87       -23
    For parent profile id 4 --> ONL category has 109 points, so no need to borrow points from OFL category
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 42,43,44).
    in this case ONL has 100 points, so move the remaining 9 points will be expired. OFL category has 169 points total. need only 100 points (i.e. mutiple of 100) for our process, 69 points will be expired and has to deduct from the profile which has highest earned points, in this case from profile 43. Output :
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    4                  4           ONL       109            0                109          9               100   100       9
    4                  42          OFL       26             0                169          69              100   -26       0
    4                  43          OFL       87             0                169          69              100   -18       -69
    4                  44          OFL       56             0                169          69              100   -56       0
    Can someone help with the query. I googled about looping in sql and came to know that Oracle has a feature MODEL to loop in SQL, but i don't have idea on using MODEL clause.
    Appreciate your help!
    Thanks
    Sri

    Hi Gurus,
    Can someone please help me out.
    I've a below tables.
    1) tbl_link --> this table contains information at profile level
    2) tbl_summary --> this table contains summary at parent profile level derived from tbl_link table
    One parent profile contains multiple child profiles and each child profile links to a code (which is B, W, G or P) and the code is linked to a category (i.e. ONL and OFL). In this case code B is linked to category 'ONL' and codes W,G,P linked to OFL category.
    ONL category needs 100 points. If it don't have enough points then i need to borrow from OFL category which i'm doing and populating into tbl_summary table at parent profile level.
    Now i need to insert data into tbl_link table at profile level with howmany points used, expired based on tbl_summary table. Rule is at the end of month if we add points for each profile in tbl_link table it should come as 0.
    with
    tbl_SUMMARY as
    select 1 as ppid,'ONL' as catgcode, 53 as earned_points,47 BORROWED_POINTS,100 CERT_POINTS,0 DISCARD_POINTS,100 used from dual
    union
    select 1 as ppid,'OFL' as catgcode, 223 as earned_points,0 BORROWED_POINTS,176 CERT_POINTS,76 DISCARD_POINTS,100 used from dual
    union
    select 2 as ppid,'ONL' as catgcode, 39 as earned_points,61 BORROWED_POINTS,100 CERT_POINTS,0 DISCARD_POINTS,100 used from dual
    union
    select 2 as ppid,'OFL' as catgcode, 90 as earned_points,0 BORROWED_POINTS,29 CERT_POINTS,29 DISCARD_POINTS,100 used from dual
    union
    select 3 as ppid,'ONL' as catgcode, 109 as earned_points,0 BORROWED_POINTS,109 CERT_POINTS,9 DISCARD_POINTS,100 used from dual
    union
    select 3 as ppid,'OFL' as catgcode, 223 as earned_points,0 BORROWED_POINTS,223 CERT_POINTS,23 DISCARD_POINTS,200 used from dual
    union
    select 4 as ppid,'ONL' as catgcode, 109 as earned_points,0 BORROWED_POINTS,109 CERT_POINTS,9 DISCARD_POINTS,100 used from dual
    union
    select 4 as ppid,'OFL' as catgcode, 169 as earned_points,0 BORROWED_POINTS,169 CERT_POINTS,69 DISCARD_POINTS,100 used from dual
    tbl_link as
    select 1 as ppid,1 as pid, 'B' as code,'ONL' as catgcode, 53 as earned_points from dual
    union
    select 1 as ppid,12 as pid, 'W' as code,'OFL' as catgcode, 26 as earned_points from dual
    union
    select 1 as ppid,13 as pid, 'G' as code,'OFL' as catgcode, 87 as earned_points from dual
    union
    select 1 as ppid,14 as pid, 'P' as code,'OFL' as catgcode, 110 as earned_points from dual
    union
    select 2 as ppid,2 as pid, 'B' as code,'ONL' as catgcode, 39 as earned_points from dual
    union
    select 2 as ppid,22 as pid, 'W' ,'OFL' as catgcode, 30 as earned_points from dual
    union
    select 2 as ppid,23 as pid, 'G' ,'OFL' as catgcode, 29 as earned_points from dual
    union
    select 2 as ppid,24 as pid, 'P' ,'OFL' as catgcode, 31 as earned_points from dual
    union
    select 3 as ppid,3 as pid, 'B' as code,'ONL' as tier_catgcode, 109 as earned_points from dual
    union
    select 3 as ppid,32 as pid, 'W' ,'OFL' , 26 as earned_points from dual
    union
    select 3 as ppid,33 as pid, 'G' ,'OFL', 87 as earned_points from dual
    union
    select 3 as ppid,34 as pid, 'P' ,'OFL' , 110 as earned_points from dual
    union
    select 4 as ppid,4 as pid, 'B' as code,'ONL' as catgcode, 109 as earned_points from dual
    union
    select 4 as ppid,42 as pid, 'W' as code,'OFL' , 26 as earned_points from dual
    union
    select 4 as ppid,43 as pid, 'G' as code,'OFL' , 87 as earned_points from dual
    union
    select 4 as ppid,44 as pid, 'P' as code,'OFL' , 56 as earned_points from dual
    final (PARENT_PROFILE_ID,PROFILE_ID,catgcode,EARNED_POINTS,BORROWED_POINTS,CERT_POINTS,DISCARD_POINTS,USED)
    as (
    select A.PPID PARENT_PROFILE_ID,B.PID PROFILE_ID,A.catgcode,B.EARNED_POINTS,BORROWED_POINTS,CERT_POINTS,DISCARD_POINTS,USED
    from tbl_SUMMARY a,tbl_link b where a.ppid=b.ppid AND A.catgcode=B.catgcode
    ORDER BY PROFILE_ID
    select * from final order by 1;
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED
    1                  1           ONL       53             47               100          0               100
    1                  14          OFL       110            0                176          76              100
    1                  13          OFL       87             0                176          76              100
    1                  12          OFL       26             0                176          76              100
    2                  2           ONL       39             61               100          0               100
    2                  24          OFL       31             0                29           29              100
    2                  23          OFL       29             0                29           29              100
    2                  22          OFL       30             0                29           29              100
    3                  32          OFL       26             0                223          23              200
    3                  33          OFL       87             0                223          23              200
    3                  34          OFL       110            0                223          23              200
    3                  3           ONL       109            0                109          9               100
    4                  42          OFL       26             0                169          69              100
    4                  43          OFL       87             0                169          69              100
    4                  44          OFL       56             0                169          69              100
    4                  4           ONL       109            0                109          9               100
    Need Output as below :
    For parent profile 1, whatever i mentioned above is not correct. Borrowed 47 points from OFL to ONL to make ONL and also from OFL category has 176 points remaining after lending to ONL and using only 100 points, remaining 76 points are discarded. Need to deduct these 76 points also from child profiles. Output will be as below.
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    1                  1           ONL       53             47               100          0               100   -53       0
    1                  12          OFL       26             0                176          76              100   -26       0
    1                  13          OFL       87             0                176          76              100   -74       -13
    1                  14          OFL       110            0                176          76              100   -47       -63
    For parent profile id 2 --> ONL category has 39 points, so borrowed 61 points from OFL category to make ONL points 100.
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 22,23,24).
    Borrowed 61 points from OFL and need to deduct this points from the profile which has highest earned points, in this case deduct from profile 24 which has 31 points, from profile 22 which has 30 points. Need output like below
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    2                  2           ONL       39             61               100          0               100   -39       0
    2                  22          OFL       30             0                29           29              100   -30       0
    2                  23          OFL       29             0                29           29              100   0         -29
    2                  24          OFL       31             0                29           29              100   -31       0
    For parent profile id 3 --> ONL category has 109 points, so no need to borrow points from OFL category
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 32,33,34).
    in this case ONL has 100 points, so move the remaining 9 points will be expired. OFL category has 223 points total. need only 200 points (i.e. mutiple of 100) for our process, 23 points will be expired and has to deduct from the profile which has highest earned points, in this case from profile 34. Output :
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    3                  3           ONL       109            0                109          9               100   -100      -9
    3                  32          OFL       26             0                223          23              200   -26       0
    3                  33          OFL       87             0                223          23              200   -87       0
    3                  34          OFL       110            0                223          23              200   -87       -23
    For parent profile id 4 --> ONL category has 109 points, so no need to borrow points from OFL category
                                Now need to populate tbl_link table at child profile level (i.e. child profiles 42,43,44).
    in this case ONL has 100 points, so move the remaining 9 points will be expired. OFL category has 169 points total. need only 100 points (i.e. mutiple of 100) for our process, 69 points will be expired and has to deduct from the profile which has highest earned points, in this case from profile 43. Output :
    PARENT_PROFILE_ID  PROFILE_ID  CATGCODE  EARNED_POINTS  BORROWED_POINTS  CERT_POINTS  DISCARD_POINTS  USED  BURN_PTS  EXPIRE_PTS
    4                  4           ONL       109            0                109          9               100   100       9
    4                  42          OFL       26             0                169          69              100   -26       0
    4                  43          OFL       87             0                169          69              100   -18       -69
    4                  44          OFL       56             0                169          69              100   -56       0
    Can someone help with the query. I googled about looping in sql and came to know that Oracle has a feature MODEL to loop in SQL, but i don't have idea on using MODEL clause.
    Appreciate your help!
    Thanks
    Sri

  • Help with Javascript/Calculations

    Hello,
    Have a building use policy for school.
    Need help with checkboxes and default values.  I can get javascript/math to work when I click check box.
    Someone wants to rent a room they check the rentRoom checkbox.  Then the enter how many rooms 1,2,3 etc..  The value for the rentRoom checkbox is $25.
    I can get it when the checkbox for rentRoom is selected the rentRoom.Total computes correctly.  However, what I want is when the form opens up a default value of $0.00 to be in there.  I also want if someone goes back and unchecks the rentRoom checkbox the value goes back to $0.00 not just blank.   Right now I am getting the error the value entered does not match the value of the field.  That is if I put the default value in options.  Basically, I can't seem to figure out the javascript code to get this to work.
    Am I asking for too much, can someone guide me to javascript to help me out.
    I have tried if/then statements and switch statements.  I just can't figure out how to get it to for lack of better a word - toggle back and forth.
    If this is not possible please tell me.  If it is too complicated tell me.  I am not using livecycle for this as we had a word document and I just used the find form fields.  I am also using Adobe Acrobat 8 Professional.
    Thanks

    Hello,
    Thanks that looks good.  I am still missing something but the calc doesn't work when I put in my variables.  I will work with it more but nothing happens.
    The one thing is I have the default value of the checkbox as 15 so don't know if that messes it up.
    Right now I get the default value of $0.00 all the time.  When I click on the check box on/off it doesn't do the calcs.
    sorry, any more input, what am i missing??
    I also changed the syntax error that was posted on your origianl post.  You had == 'Off" I changed that to 'Off'

  • Need help with a currently "in-use" form we want to switch to Adobes hosting service

    Hi, I am in desperate need of help with some issues concerning several forms which we currently use a paid third party (not Adobe) to host and "re-distribute through email"...Somehow I got charged $14.95 for YOUR service, (signed up for a trial, but never used it)..and now I am paying for a year of use of the similar service which Adobe is in control of.  I might want to port my form distribution through Adobe in the hopes of reducing the errors, problems and hassles my customers are experiencing when some of them push our  "submit button". (and I guess I am familiar with these somewhat from reading what IS available in here, and I also know that, Adobe is working to alleviate some of these " submit"  issues, so let's don't start by going backwards, here) I need solutions now for my issues or I can leave it as is, If Adobe's solution will be no better for my end users...
    We used FormsCentral to code these forms and it works for the most part (if the end-user can co-operate, and thats iffy, sometimes), but I need help with how to make it go through your servers (and not the third party folks we use now), Not being cruel or racist here, but your over the phone "support techs" are about horrible & I cannot understand them or work with any of them, so I would definitely need someone who speaks English and can understand the nuances of programming these forms, to please contact me back. (Sorry, but both those attributes will be required to be able to help me, so, no "newbie-interns" or first week trainees are gonna cut it).... If you have anyone who fits the bill on those items and would be willing to help us, please contact me back at your earliest convenience. If we have to communicate here, I will do that & I can submit whatever we need to & to whoever we need to.
    I need to get this right and working for the majority of my users and on any platform and OS.
    You may certainly call me to talk about this, and I have given my number numerous times to your (expletive deleted) time wasting - recording message thingy. So, If it's not available look it up under [email protected]
    (and you will probably get right to me, unlike my and I'm sure most other folks',  "Adobe phone-in experiences")
    Thank You,
    Michael Corman
    VinylCouture
    Phenix City, Alabama  36869

    Well, thanks for writing back...just so you know...I started using Adobe products in 1987, ...yeah...back then...like Illustrator 1 & 9" B&W Macs ...John Warnock's Helvetica's....stuff like that...8.5 x 11 LaserWriters...all that good stuff...I still have some of it working on a mac...much of it was stuff I bought. some stuff I did not...I'm not a big fan of this "cloud" thing Adobe has foisted upon the creatives of the world...which I'm sure you can tell...but the functionality and usefulness of your software can not be disputed, so feel free to do whatever we will continue to pay for, ...I am very impressed with CC PS on the 64 bit PC and perhaps I will end up paying you the stipend that you demand for the other services.
    So  I guess that brings us to our problem.. a few years back and at the height of the recession and near bankruptcy myself,  I was damn lucky and hit on something and began a small arts and crafts supply service to sell my products online to a very "niche market" ...I had a unique product and still sell that product (plus others) online...My website is www.vinylcouture.com...Strange? Yes...but there is a market it seems, for everything now, and this is the market I service...Catagorically, these are 99%+ women that use these "adhesive, sticky backed vinyl products"  to make different "craft items" that are just way too various and numerous to go into... generally older women, women who are computer illiterate for the most part...and all this is irrelevant to my problem, but I want you to have every bit of background on this and especially the demographic we are dealing with, so we can get right to the meat of the problem.
    OK...So about two years ago, I decided to offer a "plain sheet" product of a plain colored "stick back" vinyl... it is available in multiple quantities of packs ( like 5 pieces, 10 pieces, 15 pieces, in a packi  & so on)...and if you are still on my site.. go to any  "GO RIGHT TO OUR ORDER PAGE"  button, scroll down a little...and then to the "PLAIN VINYL" section...you will see the Weebly website order process.) You can back out from here, I think,..but, anyway this product is available in 63 colors + or - a few. So then the problem is,  how do they select their individual colors within that (whatever) pack?... .
    So my initial idea was to enable a "selection form" for these "colors" that would be transmitted to me via email as 'part" of the "order process".. We tried getting our customers to submit a  " a list" ( something my competitiors still do, lol, poor bastards)......but that..is just unbelievable..I can't even begin to tell you what a freakin' nightmare that was...these people cannot even count to 10, much less any higher... figuring out what colors to list and send me... well, lets just say, it wasn't working......I had to figure out a better way...Something had to be done.
    So after thinking this all out,  and yeah...due to my total ignorance, i figured that we could make a form with Live Cycle Designer (Now Forms Central)...(back then something that was bundled with Adobe Acrobat Pro), I believe, and thats what this thing was authored in... and it would be all good...LOL!
    Well not so simple...as you well know, Adobe Acrobat would NOT LET YOU EMAIL anything from itself.....it just wouldn't work (and I know why, and all that hooey), but not being one to take NO for answer,.I started looking for a way to make my little gizmo work.. So I found this company that said they can "hijack" (re-direct actually) the request to email, bypass the wah-wah, and re-transmit it to the proper parties.....for less than $100 a year,  I think...its called http://pdf-fillableforms.com/.
    A nice gentleman named Joseph Silva helped us program the thing to go to his servers and back out. Please dont hassle them...I need them...for now..it basically does work...try it...you should get back a copy of the form that you filled out...good luck however,  if you're on MAC OSX or similar...
    I have included a copy of both of our forms (and feel free to fill it out and play with it)...just put test somewhere on it...(and you must include YOUR email or it will balk)..they are supposed to be mostly identical, except one seems to be twice as large....generating a 1.7 meg file upon submission, while the other one only generates a 600K file or so...thats another issue for another day or maybe you can advise on that also...
    OK so far so good......In our shop, once Grandma buys a 10 pack (or whatever), Only then she gets to the link on her receipt page ro the relevant "selection form" ,(this prevents "Filling and Sending"  with "no order" and "no payment", another early problem we had)... which they can click on and it will usually download and open up on their device if all goes well...Then our little form is supposed to be fillable and is supposed to ADD UP all the quantities, so grandma knows how many she is buying and so forth right on the fly,  and even while she changes her mind..., and IT'S LARGE so grandma can see it, and then it TOTALS it all up for them, ( cause remember, they can NOT add)..,  except there is a programming bug (mouse-click should be a mouse-up probably or something..) which makes you click in the blank spaces to get to a correct TOTAL...about 70-80% of our customers can enable all these features and usually the process completes without problems for them especially on PC's running Windows OS and Acrobat Reader X or XI...at least for most... Unfortunately it is still not the "seamless process" I would like or had envisioned for the other folks out there that do have trouble using our form....  Many folks report to us the following issues that we know of.  First of all it takes too much time to load up...We know its HUGE...is there anyway that you can see, to streamline this thing? I would love for it to be more compact...this really helps on the phones and pads as I'm sure you well know.
    Some just tell us,"it WON'T work"....I believe this is because they are totally out of it and dont even have Adobe Reader on their machine, & don't know how to get it ( yes, we provide the links).....or it's some ancient version....no one can stop this one...
    It almost always generates some kind ( at least one time)  of "error message" which we do warn them about..., telling one,  basically that "Acrobat doesnt even like this happening at all, and it could be detrimental to ones computer files", blah-blah...(this freaks grandma out really bad)...& usually they end up not even trying to send it...  and then I get calls that even you wouldn't believe...& If they DO nut up and push the Red "Submit Form" button, it will usually send the thing to us (and also back to them at the "required email address" they furnished on the form, thats what the folks at the "fillable forms place" do) so, if it's performing it's functions, why it is having to complain?. What are we doing wrong?....and how can I fix it?...Will re-compiling it or saving it as a newer version of "FormsCentral" correct any of these problems ?
    Ok, so that should keep you busy for a minute and we can start out with those problems...but the next thing is, how can I take advantage of YOUR re-direct & hosting services?, And will it get rid of the error messages, and the slowness, and the iOS incompatibilities ? (amazingly,  the last iOS Reader version worked almost OK.. but the newest version doesnt seem to work with my form on my iphone4)  If it will enable any version of the iOS to send my form correctly and more transparently, then it might be worth the money...$14.95 a MONTH you say. hmmmmm...Better be good.
    Another problem is, that I really don't need 5000 forms a month submitted. I think its like 70-100 or less....Got any plans for that?  Maybe I'm just not BIG ENOUGH to use Adobe's services, however in this case, I really don't care whose I do use as long as the product works most correctly for my customers as well as us. Like I said, If I'm doing the best I can, I won't change anything, and still use the other third party, If Adobe has a better solution, then i'm all for that as well. In the meantime, Thanks for any help you can provide on this...
    Michael Corman
    VinylCouture.com
    (706) 326-7911

  • Need help with JTextArea and Scrolling

    import java.awt.*;
    import java.awt.event.*;
    import java.text.DecimalFormat;
    import javax.swing.*;
    public class MORT_RETRY extends JFrame implements ActionListener
    private JPanel keypad;
    private JPanel buttons;
    private JTextField lcdLoanAmt;
    private JTextField lcdInterestRate;
    private JTextField lcdTerm;
    private JTextField lcdMonthlyPmt;
    private JTextArea displayArea;
    private JButton CalculateBtn;
    private JButton ClrBtn;
    private JButton CloseBtn;
    private JButton Amortize;
    private JScrollPane scroll;
    private DecimalFormat calcPattern = new DecimalFormat("$###,###.00");
    private String[] rateTerm = {"", "7years @ 5.35%", "15years @ 5.5%", "30years @ 5.75%"};
    private JComboBox rateTermList;
    double interest[] = {5.35, 5.5, 5.75};
    int term[] = {7, 15, 30};
    double balance, interestAmt, monthlyInterest, monthlyPayment, monPmtInt, monPmtPrin;
    int termInMonths, month, termLoop, monthLoop;
    public MORT_RETRY()
    Container pane = getContentPane();
    lcdLoanAmt = new JTextField();
    lcdMonthlyPmt = new JTextField();
    displayArea = new JTextArea();//DEFINE COMBOBOX AND SCROLL
    rateTermList = new JComboBox(rateTerm);
    scroll = new JScrollPane(displayArea);
    scroll.setSize(600,170);
    scroll.setLocation(150,270);//DEFINE BUTTONS
    CalculateBtn = new JButton("Calculate");
    ClrBtn = new JButton("Clear Fields");
    CloseBtn = new JButton("Close");
    Amortize = new JButton("Amortize");//DEFINE PANEL(S)
    keypad = new JPanel();
    buttons = new JPanel();//DEFINE KEYPAD PANEL LAYOUT
    keypad.setLayout(new GridLayout( 4, 2, 5, 5));//SET CONTROLS ON KEYPAD PANEL
    keypad.add(new JLabel("Loan Amount$ : "));
    keypad.add(lcdLoanAmt);
    keypad.add(new JLabel("Term of loan and Interest Rate: "));
    keypad.add(rateTermList);
    keypad.add(new JLabel("Monthly Payment : "));
    keypad.add(lcdMonthlyPmt);
    lcdMonthlyPmt.setEditable(false);
    keypad.add(new JLabel("Amortize Table:"));
    keypad.add(displayArea);
    displayArea.setEditable(false);//DEFINE BUTTONS PANEL LAYOUT
    buttons.setLayout(new GridLayout( 1, 3, 5, 5));//SET CONTROLS ON BUTTONS PANEL
    buttons.add(CalculateBtn);
    buttons.add(Amortize);
    buttons.add(ClrBtn);
    buttons.add(CloseBtn);//ADD ACTION LISTENER
    CalculateBtn.addActionListener(this);
    ClrBtn.addActionListener(this);
    CloseBtn.addActionListener(this);
    Amortize.addActionListener(this);
    rateTermList.addActionListener(this);//ADD PANELS
    pane.add(keypad, BorderLayout.NORTH);
    pane.add(buttons, BorderLayout.SOUTH);
    pane.add(scroll, BorderLayout.CENTER);
    addWindowListener( new WindowAdapter()
    public void windowClosing(WindowEvent e)
    System.exit(0);
    public void actionPerformed(ActionEvent e)
    String arg = lcdLoanAmt.getText();
    int combined = Integer.parseInt(arg);
    if (e.getSource() == CalculateBtn)
    try
    JOptionPane.showMessageDialog(null, "Got try here", "Error", JOptionPane.ERROR_MESSAGE);
    catch(NumberFormatException ev)
    JOptionPane.showMessageDialog(null, "Got here", "Error", JOptionPane.ERROR_MESSAGE);
    if ((e.getSource() == CalculateBtn) && (arg != null))
    try{
    if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 1))
    monthlyInterest = interest[0] / (12 * 100);
    termInMonths = term[0] * 12;
    monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest,  -termInMonths))));
    lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
    if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 2))
    monthlyInterest = interest[1] / (12 * 100);
    termInMonths = term[1] * 12;
    monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest,  -termInMonths))));
    lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
    if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 3))
    monthlyInterest = interest[2] / (12 * 100);
    termInMonths = term[2] * 12;
    monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest,  -termInMonths))));
    lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
    catch(NumberFormatException ev)
    JOptionPane.showMessageDialog(null, "Invalid Entry!\nPlease Try Again", "Error", JOptionPane.ERROR_MESSAGE);
    }                    //IF STATEMENTS FOR AMORTIZATION
    if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 1))
    loopy(7, 5.35);
    if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 2))
    loopy(15, 5.5);
    if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 3))
    loopy(30, 5.75);
    if (e.getSource() == ClrBtn)
    rateTermList.setSelectedIndex(0);
    lcdLoanAmt.setText(null);
    lcdMonthlyPmt.setText(null);
    displayArea.setText(null);
    if (e.getSource() == CloseBtn)
    System.exit(0);
    private void loopy(int lTerm,double lInterest)
    double total, monthly, monthlyrate, monthint, monthprin, balance, lastint, paid;
    int amount, months, termloop, monthloop;
    String lcd2 = lcdLoanAmt.getText();
    amount = Integer.parseInt(lcd2);
    termloop = 1;
    paid = 0.00;
    monthlyrate = lInterest / (12 * 100);
    months = lTerm * 12;
    monthly = amount *(monthlyrate/(1-Math.pow(1+monthlyrate,-months)));
    total = months * monthly;
    balance = amount;
    while (termloop <= lTerm)
    displayArea.setCaretPosition(0);
    displayArea.append("\n");
    displayArea.append("Year " + termloop + " of " + lTerm + ": payments\n");
    displayArea.append("\n");
    displayArea.append("Month\tMonthly\tPrinciple\tInterest\tBalance\n");
    monthloop = 1;
    while (monthloop <= 12)
    monthint = balance * monthlyrate;
    monthprin = monthly - monthint;
    balance -= monthprin;
    paid += monthly;
    displayArea.setCaretPosition(0);
    displayArea.append(monthloop + "\t" + calcPattern.format(monthly) + "\t" + calcPattern.format(monthprin) + "\t");
    displayArea.append(calcPattern.format(monthint) + "\t" + calcPattern.format(balance) + "\n");
    monthloop ++;
    termloop ++;
    public static void main(String args[])
    MORT_RETRY f = new MORT_RETRY();
    f.setTitle("MORTGAGE PAYMENT CALCULATOR");
    f.setBounds(600, 600, 500, 500);
    f.setLocationRelativeTo(null);
    f.setVisible(true);
    }need help with displaying the textarea correctly and the scroll bar please.
    Message was edited by:
    new2this2020

    What's the problem you're having ???
    PS.

  • Need help with date and time calculations please

    Hello there.. Im stuck, and im hoping someone can help..
    Working on a list to manage and track PTO.  User completes PTO request form,
    Fields
    Name
    Start Date (with time)
    End Date (with time)
    Total Number of Days/hours requested: (calculation)
    Full Day: (Yes/No)
    ok business need
    user has the ability to request a certain number of hours as opposed to a full day.
    After searching around on google. I found this calculation to help me figure out how many BUSINESS days being requested.
    =IF(ISERROR(DATEDIF([Start Date],[End Date],"d")),"",(DATEDIF([Start Date],[End Date],"d"))+1-INT(DATEDIF([Start Date],[End Date],"d")/7)*2-IF((WEEKDAY([End Date])-WEEKDAY([Start Date]))<0,2,0)-IF(OR(AND(WEEKDAY([End
    Date])=7,WEEKDAY([Start Date])=7),AND(WEEKDAY([End Date])=1,WEEKDAY([Start Date])=1)),1,0)-IF(AND(WEEKDAY([Start Date])=1,(WEEKDAY([End Date])-WEEKDAY([Start Date]))>0),1,0)-IF(AND(NOT(WEEKDAY([Start Date])=7),WEEKDAY([End Date])=7),1,0))
    This works great as long as its a [Full Day]="YES", displays results in column labeled Number of days
    now if [Full Day]="No", displays results in column labeled Number of Hours
    BUT this is my issue (well part of it) it calcuate the correct number of hours.. but puts a "1" in "Number of Days" why.. dates have not changed.. I think Its something with the above calculation but I could be way off.
    the end result is I need number of days to concat with number of hours 
    i.e 1 full day 4 hours  1.4
        0 full day 5 hours  0.5
        1 full day 0 hours  1.0
    so that the total can be deducted via workflow.. from the remaining balance in a tracker. (seperate list) 
    Any angels out there??

    Posnera-
    Try changing time zones and see if the travel itinerary times change.
    Fred

  • The best way to get help with logic

    I was posting in a thread on support for logic which appears to have been deleted. anyway, what I was going to say I think is useful info for people, so I'm going to post it anyway. to the mods - it doesn't contain any speculation about policies or anything like that. just an explanation of my views on the best way to deal with issues people have with logic, which I think is a valuable contribution to this forum.
    I think there's a need for perspective. when you buy an apple product you get 90 days of free phone support to get everything working nice and neat. you can call them whenever, and you could actually keep them on the phone all day if you wanted, making them explain to you how to copy a file, install microsoft office, or any number of little questions no matter how simple - what is that red button thingy in my window for?.. on top of that, you've got a 14 day dead on arrival period (or 10 days I can't remember) in which if your machine has any kind of hardware fault whatsoever it's exchanged for a totally new one, no questions asked. a lot of people complain that applecare is overpriced.. and if you think of it just as an extended warranty, then it is a little pricey. but if you are someone that could use a lot of phone support, then it's actually potentially a total bargain. the fact that 2 or more years after you bought a computer, you could still be calling them every single day, asking for any kind of advice on how to use anything on the machine, is quite something. many people on this forum have had problems when they made the mistake of upgrading to 10.4.9 without first creating a system clone or checking first with their 3rd party plug in vendors to make sure it was ok. so, with apple care, you could call them and keep a technician on the phone _all day_ talking you through step-by-step how to back up all of your user data, how to go through and preserve your preferences and any other specific settings you might not want to lose, and then how to rollback to an earlier OS version.. they'll hold your hand through the whole thing if you need them to.
    as for applecare support for pro apps like logic, I'd be the first person to agree that it's not great for anyone except beginners and first time users. if you look at what it takes to get even the highest level of logic certification, it's all pretty basic stuff. and logic doesn't exist in a vacuum, there is an entire universe of 3rd party software and hardware, as well as studio culture and advanced user techniques that are going to be totally invisible to some poor phone support guy at apple that did a logic 101. but it's not hard to see that apple are trying to promote a different kind of support culture, it's up to you to decide whether you want to buy into it or not.
    the idea is that they are able to provide basic setup support for new users, including troubleshooting. because it's a simpler level of support, at least they can do this well. so there's no reason why any new user with say a new imac and logic can't get up and running with the 90 days of phone support they get for free.
    but the thing is, for extremely high end pro users it's a different matter altogether. pro use of logic within the context of say, a studio or a film composition scenario is a very different world. it's almost a nonsense to imagine that apple could even hire people capable of giving useful support for this end of the spectrum, over the phone. there are so many variables, and so many things that require a very experienced studio person or in-work composer to even begin to understand the setup, let alone troubleshoot it. and it's a constantly evolving world, you actually have to be working in it and aware of developments on 3rd party fronts as well as changes in hardware.. not to mention even changes in the culture of studio production and the changed expectations that come from that. there's no way some poor little guy sitting at a help desk at apple can even hope to be privy to that kind of knowledge. it's already good enough that they don't outsource their support staff to india, let alone go out to studios and hire the very people with the skills that should be staying in the studio! not answering phones for apple.
    so, given this reality.. companies have two choices. they can either offer an email based support ticket system, which others do. but in my opinion.. this can just be frustrating and only a half-solution. sure you 'feel' like you are getting a response from the people that make the software and therefore must know it.. but it's not really the case due to what I said above. DAWs don't exist in a vacuum, and so much of what you need to understand to help people requires an intimate knowledge of the music industry in which they are working. you still won't get that from steinberg, even if they sort of answer your emails. the other problem is that this kind of system can mean sporadic answers, a lot of tail-chasing, and quite often you won't get an answer that helps you in the end anyway.
    the other model is to foster a strong user support culture. some people react in the wrong way to this idea.. they just think it's a big brush off from the manufacturer, saying we don't care, go sort it out yourselves.. but this isn't true. apple has a classification for pro resellers called 'apple solutions expert - audio'. what this means is that these dealers are recognised as audio specialists and they can receive extra support and training from apple for this. but more importantly than this.. most of them are music stores, or pro gear dealerships that are also mac and logic dealers. they already employ people that have worked or do work in the music industry, and are constantly on top of all of this stuff. apple encourages these dealers to run workshops, and to provide expert sales advice in the very niche area that logic is in, which they can do far better than some generic apple store ever could. but most importantly, they are encouraged to offer their own expert after-sales support and whatever other value-adding expertise they can, to get sales. because margins in computer gear are so tight nowadays, discounting is not really a viable option for these dealers to guarantee getting musicians to buy computers and logic setups from them. the only companies that can entice people with a lower price a big online wholesalers or big chain stores. so the best idea for these niche expert stores to get sales is to offer you their own experts to help with configuration, ongoing support and to generally make it a better idea that you bought your system from them rather than from some anonymous online store. I can see the wisdom of this.. it puts the support back out there on the ground where it's needed, and also where it can work best. apple could never hope to offer the same level of expertise in helping a film composer work through some issues with a specific interface or some highly specific issue they have with getting a task done. no big software manufacturer could do this anywhere near as well as people out there that have worked in studios or currently do work in studios. so in my opinion it's a far better model to foster this kind of support culture, along with training courses, books and training video support. also user forums like this one are possibly one of the most valuable ports of call anyone could ask for. apple couldn't replicate this with their own staff, even if they tried. and even if they made a system where some of the people close to logic development were able to answer emails, it would still be nowhere near as useful, as rapid or as capable of being up to speed with logic use out in the real world with 3rd pary gear, as any of these other methods are.
    the only thing I think they could do better would be to publish a list of known bugs which are officially recognised. this would help everyone and put an end to a lot of wasted time and speculation on if something is a bug totally to do with logic, or if it's a specific issue raised by a particular configuration.
    but really, in my view, a 3rd party support and training culture through a combination of specialist dealers, consultants that literally run a business setting up computers for pro-users and helping them keep it all working, online user-to-user forums and published materials really are the way forward.

    In all honesty this is currently the 3rd "logicboard" (motherboard)
    in my powerbook due to a design flaw regarding the 2nd memory slot....
    Yep. Mine failed five weeks after I bought it. However, I bought it for work and couldn't afford being without it for four weeks while they fixed it, so I had to live with it. My serial number did not entitle me to a replacement either, post Applecare.
    My firewire ports have burnt out from a third-party defective device (no hot-plugging involved)
    My screen is blotchy (my PW serial number did not entitle me to a replacement).
    My battery serial number did not entitle me to a replacement, and is not that good these days.
    My guaranteed Powerbook-compatible RAM is actually not, causing RAM related problems, most notably these days meaning that as soon as I switch to battery power, the laptop crashes, so I can only use mains power. The company I bought it from stopped taking my calls and wouldn't replace it after they replaced it once, so I'm stuck with it. And of course, only one ram slot is working, so I can't even use my original stick in the first slot, which would shift the dodgy stuff away from the lower system area.
    My power supply failed at the weak spot and caught fire. I managed to break apart the power supply and recable it so I didn't have to buy a new power supply, although the connection at the laptop end is loose (all the more fun that as soon as power is lost, the laptop crashes - see above). The power supply is held together with gaffa tape. Silver gaffer tape though, so it's still kind of 'Appley"...
    My internal hard drive is dying - four or five times now it clicks and won't power up, causing the laptop to die.
    One foot has fallen off (but glued back on).
    The lid is warped.
    The hinge is loosish.
    The S-Video adaptor cable is intermittent.
    But aside from all that, I have looked after it well, and I love it to death. Just as well, because it doesn't look like it will be that long...
    But it still "just works". Apart from the battery power obviously. And the ram slot. And the ram. And the screen. And the hard drive. And the firewire ports. And the feet.
    But everything apart from the main board, the screen, the case, the hard drive and the power supply works fine. So thats... er..
    Hmm.

  • Need help with conditional query

    guys this is just an extension of this post that Frank was helping me with. im reposting because my requirements have changes slightly and im having a hell of a time trying to modify the query.
    here is the previous post.
    need help with query that can look data back please help.
    CREATE TABLE "FGL"
        "FGL_GRNT_CODE" VARCHAR2(60),
        "FGL_FUND_CODE" VARCHAR2(60),
        "FGL_ACCT_CODE" VARCHAR2(60),
        "FGL_ORGN_CODE" VARCHAR2(60),
        "FGL_PROG_CODE" VARCHAR2(60),
        "FGL_GRNT_YEAR" VARCHAR2(60),
        "FGL_PERIOD"    VARCHAR2(60),
        "FGL_BUDGET"    VARCHAR2(60)
      )data
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','00','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','1','0');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','11','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7200','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('360055','360055','7600','4730','02','10','1','400');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7600','4730','02','10','14','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','14','200');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','10','2','100');
    Insert into FGL (FGL_GRNT_CODE,FGL_FUND_CODE,FGL_ACCT_CODE,FGL_ORGN_CODE,FGL_PROG_CODE,FGL_GRNT_YEAR,FGL_PERIOD,FGL_BUDGET) values ('240055','240055','7240','4730','02','11','2','600');
    I need to find the greatest grant year for the grant by a period parameter.
    once i find the greatest year i need to check the value of period 14 for that grant for the previous year and add it to the budget amount for that grant. however if their is an entry in the greatest year for period 00 then i need to ignore the period 14 of previous year and do this calculation current period +(current period - greatest year 00)
    hope that makes sense so in other words with the new data above. if i was querying period two of grant year 11. i would end up with $800
    because the greatest year is 11 it contains a period 0 with amount of $400 so my total should be
    period 2 amount $ 600
    period 0 amount $ 400 - period 2 amount of $600 = 200
    600+200 = $800
    if i query period 1 of grant 360055 i would just end up with 800 of grnt year 10.
    i have tried to modify that query you supplied to me with no luck. I have tried for several day but im embarrased to say i just can get it to do what im trying to do .
    can you please help me out.
    here is the query supplied by frank kulash who gracefully put this together for me.
    WITH     got_greatest_year     AS
         SELECT     fgl.*     -- or whatever columns are needed
         ,     MAX ( CASE
                     WHEN  fgl_period = :given_period
                     THEN  fgl_grnt_year
                    END
                  ) OVER ()     AS greatest_year
         FROM     fgl
    SELECT     SUM (fgl_budget)     AS total_budget     -- or SELECT *
    FROM     got_greatest_year
    WHERE     (     fgl_grnt_year     = greatest_year
         AND     fgl_period     = :given_period
    OR     (     fgl_grnt_year     = greatest_year - 1
         AND     fgl_period     = 14
    ;Miguel

    Hi, Miguel,
    Are you waying that, when the greatest year that has :given_period also has period='00' (or '0', or whatever you want to use), then you want to double the budget from the given_period (as well as subtract the budget from the '00', and not count the pevious year's '14')? If so, add another condition to the CASE statement which decides what you're SUMming:
    WITH     got_greatest_year     AS
         SELECT       TO_NUMBER (fgl_grnt_year)     AS grnt_year
         ,       fgl_period
         ,       TO_NUMBER (fgl_budget)     AS budget
         ,       MAX ( CASE
                       WHEN  fgl_period = :given_period
                       THEN  TO_NUMBER (fgl_grnt_year)
                      END
                    ) OVER ()     AS greatest_year
         FROM       fgl
    ,     got_cnt_00     AS
         SELECT     grnt_year
         ,     fgl_period
         ,     budget
         ,     greatest_year
         ,     COUNT ( CASE
                       WHEN  grnt_year     = greatest_year
                       AND       fgl_period     = '00'
                       THEN  1
                         END
                    ) OVER ()          AS cnt_00
         FROM    got_greatest_year
    SELECT       SUM ( CASE
                        WHEN  grnt_year     = greatest_year                    -- New
                  AND       fgl_period     = :given_period                    -- New
                  AND       cnt_00     > 0            THEN  budget * 2     -- New
                        WHEN  grnt_year     = greatest_year
                  AND       fgl_period     = :given_period       THEN  budget
                        WHEN  grnt_year     = greatest_year
                  AND       fgl_period     = '00'            THEN -budget
                        WHEN  grnt_year     = greatest_year - 1
                  AND       fgl_period     = '14'     
                  AND       cnt_00     = 0            THEN  budget
                    END
               )          AS total_budget
    FROM       got_cnt_00
    ;You'll notice this is the same as the previous query I posted, except for 3 lines maked "New".

  • Please help with my incessant spinning wheel of death!

    I have almost always had the spinning circle of death…  Almost the whole life of this late 2011 15" 4 GB mbp.  I just can not easily use this computer anymore. It takes so long to do anything.  I need to exit all apps but the one I am using to make it work.  I have to restart is almost daily to make it do much.  So frustrating! Please help! 
    I already tried a disk repair under disk utlility with no issues shown.
    I read on another post to run an etrecheck app and to post that info.  Here is what it says.
    EtreCheck version: 2.1.8 (121)
    Report generated March 3, 2015 at 11:54:29 AM CST
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Hardware Information: ℹ️
        MacBook Pro (15-inch, Late 2011) (Technical Specifications)
        MacBook Pro - model: MacBookPro8,2
        1 2.2 GHz Intel Core i7 CPU: 4-core
        4 GB RAM Upgradeable
            BANK 0/DIMM0
                2 GB DDR3 1333 MHz ok
            BANK 1/DIMM0
                2 GB DDR3 1333 MHz ok
        Bluetooth: Old - Handoff/Airdrop2 not supported
        Wireless:  en1: 802.11 a/b/g/n
        Battery Health: Normal - Cycle count 395
    Video Information: ℹ️
        Intel HD Graphics 3000 - VRAM: 384 MB
            Color LCD 1280 x 800
        AMD Radeon HD 6750M - VRAM: 512 MB
    System Software: ℹ️
        OS X 10.10.1 (14B25) - Time since boot: 0:14:27
    Disk Information: ℹ️
        Hitachi HTS545050B9A302 disk0 : (500.11 GB)
            EFI (disk0s1) <not mounted> : 210 MB
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
            Macintosh HD (disk1) / : 498.88 GB (201.30 GB free)
                Encrypted AES-XTS Unlocked
                Core Storage: disk0s2 499.25 GB Online
        MATSHITADVD-R   UJ-8A8
    USB Information: ℹ️
        Apple Inc. FaceTime HD Camera (Built-in)
        Apple Inc. BRCM2070 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple Inc. Apple Internal Keyboard / Trackpad
        Apple Computer, Inc. IR Receiver
    Thunderbolt Information: ℹ️
        Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Kernel Extensions: ℹ️
            /Library/Application Support/MacKeeper/AntiVirus.app
        [not loaded]    net.kromtech.kext.AVKauth (2.3.7 - SDK 10.9) [Click for support]
        [loaded]    net.kromtech.kext.Firewall (2.3.7 - SDK 10.9) [Click for support]
            /System/Library/Extensions
        [not loaded]    com.FTDI.driver.FTDIUSBSerialDriver (2.2.14) [Click for support]
        [not loaded]    com.bodymedia.codelessAB185.kext (1) [Click for support]
    Launch Daemons: ℹ️
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [running]    com.mackeeper.MacKeeper.plugin.AntiTheft.daemon.plist [Click for support]
        [loaded]    com.microsoft.office.licensing.helper.plist [Click for support]
        [running]    com.zeobit.MacKeeper.AntiVirus.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.adobe.ARM.[...].plist [Click for support]
        [running]    com.mackeeper.MacKeeper.Helper.plist [Click for support]
    User Login Items: ℹ️
        iTunesHelper    Application Hidden (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
        HP Product Research    UNKNOWN  (missing value)
    Internet Plug-ins: ℹ️
        Default Browser: Version: 600 - SDK 10.10
        Flip4Mac WMV Plugin: Version: 2.4.2.4 [Click for support]
        NP_2020Player_WEB: Version: 5.0.9.0 - SDK 10.6 [Click for support]
        AdobePDFViewerNPAPI: Version: 11.0.10 - SDK 10.6 [Click for support]
        FlashPlayer-10.6: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        Silverlight: Version: 5.1.30514.0 - SDK 10.6 [Click for support]
        Flash Player: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        QuickTime Plugin: Version: 7.7.3
        SharePointBrowserPlugin: Version: 14.4.8 - SDK 10.6 [Click for support]
        AdobePDFViewer: Version: 11.0.10 - SDK 10.6 [Click for support]
        CouponPrinter-FireFox_v2: Version: 1.1.10 - SDK 10.6 [Click for support]
        JavaAppletPlugin: Version: Java 7 Update 45 Check version
    User internet Plug-ins: ℹ️
        Google Earth Web Plug-in: Version: 6.2 [Click for support]
    Safari Extensions: ℹ️
        Pin It Button
    3rd Party Preference Panes: ℹ️
        Flash Player  [Click for support]
    Time Machine: ℹ️
        Skip System Files: NO
        Mobile backups: ON
        Auto backup: YES
        Volumes being backed up:
            Macintosh HD: Disk size: 498.88 GB Disk used: 297.57 GB
        Destinations:
            Data [Network]
            Total size: 3.00 TB
            Total number of backups: 20
            Oldest backup: 2014-11-12 12:23:49 +0000
            Last backup: 2015-03-03 17:22:41 +0000
            Size of backup disk: Excellent
                Backup size 3.00 TB > (Disk size 498.88 GB X 3)
    Top Processes by CPU: ℹ️
             7%    WindowServer
             0%    fontd
             0%    Memory Clean
             0%    AppleSpell
             0%    notifyd
    Top Processes by Memory: ℹ️
        279 MB    AntiVirus
        146 MB    Safari
        146 MB    MacKeeper Helper
        90 MB    WindowServer
        73 MB    ocspd
    Virtual Memory Information: ℹ️
        410 MB    Free RAM
        2.07 GB    Active RAM
        606 MB    Inactive RAM
        1.12 GB    Wired RAM
        2.19 GB    Page-ins
        725 KB    Page-outs
    Diagnostics Information: ℹ️
        Mar 3, 2015, 11:38:29 AM    Self test - passed
        Mar 3, 2015, 10:33:54 AM    /Library/Logs/DiagnosticReports/softwareupdated_2015-03-03-103354_[redacted].cp u_resource.diag [Click for details]

    I just saw a post on MacKeeper causing serious issues...  Is that something that could be attributing to my problems?? 

  • Help with looping and counting

    i am in a CS 1 class and need help with this loop
    /*Write a program that will allow the user to enter a character
              until the capital letter Z is entered
         The program should count the number of letters entered
              and print the total after the loop is completed*/
    here is what i have it doesn't end nor does it count and i don't know hwo to make it count also i suck at do..while loops hehe
    char b,Z=0;
              Scanner a = new Scanner(System.in);
         do
                   System.out.print("Enter a letter: "+"\n");
                   b=a.next().charAt(0);
              while (b !=Z);
    i know that its not even close to being right just help me out here
    Edited by: purplesmurf on Nov 14, 2008 7:25 PM

    The following program will count the number of chacters entered until Z is enetered.
    import java.io.*;
    class count
         public static void main(String[] args)throws IOException
              char ch;
              int cnt=0;
              DataInputStream br=new DataInputStream(System.in);
              do
              System.out.print("Enter a character:");
              ch=(char)br.read();
              if(ch!='Z')
                   cnt++;
              else
                   break;
              }while((ch=(char)br.read())!='Z');
              System.out.println("The Number of entered characters are:"+cnt);
    }

Maybe you are looking for

  • Missing the visual upgrade option on SP 2010 site

    I have a series of content databases that were upgraded from MOSS 2007. Most have not yet undergone the visual upgrade. Today, I have been working on copying two of those sites to a new location. I created two new team sites. These of course already

  • Lost video conference capability

    Yesterday morning at home I had multi-chat capability, as indicated by the multiple camera icon at the top of the iChat window. Took MBP to work, no firewall access, quit iChat (I haven't rebooted by MBP for 3 weeks, just sleep). Took the MBP home, r

  • New keyboard first time connection to a Mac

    I am developing a hardware interface that enumerated like HID Keyboard. What I would like to know is how overcome the issue of having to press specific keys the first time the device is plugged in before the keyboard will work as normal. The reason i

  • Combining selectOneRadio with other content but text?

    Hi! I got a quite simpel task I am currently not able to manage with JSF. I want to combine some Radio-Buttons with content like images or video, simply showing a radiobox in front an image and another and so on. So in terms of JSF i thought i had to

  • Display a Canon raw file as shot in Aperture?

    I believe a number of settings are saved along with the image in a Canon raw file, such as. White Balance, colour space, Saturation, Contrast, sharpness and picture style as well as a few more things. Is it possible for Apreture to display the image