Amend previous solution for YTD totals:  need PTD also

Last week I received help on getting YTD totals on a 5 week period-to-date report. Data and solution are below.
I've got a period to date report with following columns:
week1 tots, week2 tots, week3 tots, week4 tots, week5 tot, period-to-date tots, year-to-date tots
The records for one hot dog stands looks like in the following format:
HOT_DOG_STAND_ID       WEEK_NBR               NET_SALES2             BUNS24434              PICKELS_AW38           MUSTARD_TB56           CHICKENHEADS33         PIECES_SOLD34          SCRAPS35               PIECES_UNACCOUNTED     HEAD_AVERAGE           EFFICIENCY            
141                    0                      647064.59              691287.4               149142.91     
141                    1                      697227.09              694887.4               139149.31             
141                    2                      293067.04              344887.4               159159.91             
141                    3                      693467.09              695687.5               139149.91             
141                    4                      644067.09              595487.4               635149.94 
141                    5                      644067.09              595487.4               635149.94               
141                    7                     6897467.09            12694887.6             34139169.34                                Week nbr 0 is sum of weeks from beginning of year to the end of previous period
week 1 - 5 are the totals for each week in the period
week 7 represents the the year to date total
(totals for #7 are only for display and are not correct)
I was not concerned with PTD totals (sum of weeks 1 to 5); I simply UNION ALL'ed a second SELECT from first query summing on week 1 - 5
The client program throws error:
"unsupported case for inlining of query name in WITH clause". Googling suggest it is most likely most likely because of the UNION ALL
So I do need to get the PTD totals in a record with Week number 6.
  CREATE TABLE PERIOD_DATA
   (     "HOT_DOG_STAND_ID" NUMBER NOT NULL ENABLE,
     "WEEK_DATE" DATE,
     "NET_SALES2" NUMBER,
     "BUNS24434" NUMBER,
     "PICKELS_AW38" NUMBER,
     "MUSTARD_TB56" NUMBER,
     "CHICKENHEADS33" NUMBER,
     "PIECES_SOLD34" NUMBER,
     "SCRAPS35" NUMBER,
     "PIECES_UNACCOUNTED" NUMBER
REM INSERTING into PERIOD_DATA
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('29-DEC-08','DD-MON-RR HH.MI.SSXFF AM'),14301.39,13951.26,3431.13,0,3680,2484,378,818);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('05-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),14651.37,14651.37,3249.55,0,3200,2419,505,276);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('12-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),14169.89,14169.89,2463.53,0,3136,2080,474,582);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('19-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),15864.46,15864.46,3245.49,0,3472,2764,475,233);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('26-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),15961.2,15916.23,3395.51,0,3648,2838,392,418);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('02-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),19066.4,19066.4,4165.07,0,4336,3682,333,321);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('09-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),18415.74,18415.74,4024.74,0,4032,3365,482,185);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('16-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),18014,17849,3486.33,0,3840,3238,374,228);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('23-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),18671.09,18626.12,3729.42,0,3888,2970,353,565);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('02-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),17636,17636,3815,0,3424,2840,490,94);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('09-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),17235.52,17145.58,3897.42,0,3504,2928,421,155);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('16-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),15989.27,15989.27,3372.95,0,3728,3051,369,308);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('23-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),19067.69,18960.41,4152.6,0,4048,3293,442,313);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('30-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),18717.99,18717.99,3923.69,0,4408,3219,593,596);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('06-APR-09','DD-MON-RR HH.MI.SSXFF AM'),17335.16,17335.16,3769.08,0,3928,2997,514,417);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('13-APR-09','DD-MON-RR HH.MI.SSXFF AM'),18967.39,18967.39,4157.76,0,4144,2991,527,626);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('20-APR-09','DD-MON-RR HH.MI.SSXFF AM'),23090.88,23090.88,4427.96,0,5544,4493,560,491);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('27-APR-09','DD-MON-RR HH.MI.SSXFF AM'),24197.98,24132.99,4248.66,0,6680,5190,606,884);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('04-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),20202.21,20137.22,3714.68,0,7052,6170,422,460);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('11-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),18514.48,18514.48,3266.06,0,5508,4178,571,759);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('18-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),18678.68,18678.68,3814.07,0,5824,4345,633,846);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('25-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),17937.18,17937.18,3051.52,0,4844,4986,529,-671);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('01-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17445.75,17445.75,3079.91,0,5028,4810,656,-438);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('08-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17327.88,17327.88,3263.29,0,6112,4674,672,766);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('15-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17241.72,16937.33,3328.27,0,5792,4490,567,735);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('22-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),16625.83,16625.83,3485.18,0,5408,4319,761,328);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('29-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17002.84,17002.84,3091.09,0,5664,4369,544,751);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('06-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),16339.19,16274.2,3075.3,0,4784,3440,697,647);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('13-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),17165.12,16885.14,3458.03,0,4320,3296,640,384);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('20-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),17029.77,16899.79,3198.91,0,4448,3449,645,354);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('27-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),16596.89,16596.89,3015.54,0,4624,3288,665,671);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('03-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),16468.58,16468.58,2981.35,0,2224,3495,564,-1835);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('10-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),18625.48,18550.5,3524.44,0,4856,3482,578,796);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('17-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),24538.54,24323.55,5580.71,0,5260,3771,608,881);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('24-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),18081.37,18081.37,3533.45,0,5980,3080,553,2347);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('31-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),17183.25,17183.25,3487.12,0,2544,3262,615,-1333);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('07-SEP-09','DD-MON-RR HH.MI.SSXFF AM'),17688.41,17575.29,3424.17,0,4800,3480,591,729);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('14-SEP-09','DD-MON-RR HH.MI.SSXFF AM'),18211.29,18211.29,3806.32,0,3968,3104,527,337);
Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('21-SEP-09','DD-MON-RR HH.MI.SSXFF AM'),16809.21,16744.22,3014.61,0,4128,3124,710,294);
SELECT HOT_DOG_STAND_ID
, DECODE(TRUNC(week_date , 'iw') ,
         to_date('24-AUG-09' , 'dd-mon-rr') , 1 ,
         to_date('24-AUG-09' , 'dd-mon-rr') + 7 , 2 ,
         to_date('24-AUG-09' , 'dd-mon-rr') + 14 , 3 ,
         to_date('24-AUG-09' , 'dd-mon-rr') + 21 , 4 ,
         to_date('24-AUG-09' , 'dd-mon-rr') + 28 , 5 , 0) AS week_nbr
, SUM(NET_SALES2)                                                                                                                                                                                                                                                     AS net_sales2
, SUM(BUNS24434 ) BUNS24434
, SUM(PICKELS_AW38) PICKELS_AW38
, SUM(MUSTARD_TB56) MUSTARD_TB56
, SUM(CHICKENHEADS33) CHICKENHEADS33
, SUM(PIECES_SOLD34) PIECES_SOLD34
, SUM(SCRAPS35) SCRAPS35
, SUM(PIECES_UNACCOUNTED) * - 1 PIECES_UNACCOUNTED
   /*--== Head average  net_sales / chickenusage*/
, CASE
      WHEN NVL( SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
      ELSE ROUND(SUM(net_sales2) / ( SUM(ChickenHeads33) / 8 ) , 2)
   END AS Head_average
   /*--=== Efficiency =   (ChickenUsage  - scrappedDiv8 - unaccountedDiv8) / ChickenUsage)  * 100*/
, CASE
      WHEN NVL(SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
      ELSE ROUND((((SUM(ChickenHeads33) / 8 ) - ( SUM(scraps35) / 8 ) - (SUM(pieces_unaccounted) / 8 )) / (SUM(ChickenHeads33) / 8 )) * 100 , 2)
   END AS efficiency
FROM period_data per
WHERE week_DATE BETWEEN TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IY') AND TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IW') + 6 + 7 * 4
GROUP BY hot_dog_stand_id
, DECODE(TRUNC(week_date , 'iw') ,
      to_date('24-AUG-09' , 'dd-mon-rr') , 1 ,
      to_date('24-AUG-09' , 'dd-mon-rr') + 7 , 2 ,
      to_date('24-AUG-09' , 'dd-mon-rr') + 14 , 3 ,
      to_date('24-AUG-09' , 'dd-mon-rr') + 21 , 4 ,
      to_date('24-AUG-09' , 'dd-mon-rr') + 28 , 5 ,
      0)
ORDER BY DECODE(TRUNC(week_date , 'iw') , to_date('24-AUG-09' , 'dd-mon-rr') , 1 , to_date('24-AUG-09' , 'dd-mon-rr') + 7 , 2 , to_date('24-AUG-09' , 'dd-mon-rr') + 14 , 3 , to_date('24-AUG-09' , 'dd-mon-rr') + 21 , 4 , to_date('24-AUG-09' , 'dd-mon-rr') + 28 , 5 , 0);The following was the successful solution: see: Need help getting YTD total
VARIABLE   start_date     VARCHAR2 (11);
EXEC         :start_date  := '24-AUG-2009';
     SELECT  HOT_DOG_STAND_ID
     ,      NVL (CASE
               WHEN  week_date >= TO_DATE( :start_date, 'DD-MON-YYYY')
               AND   week_date <  TO_DATE( :start_date, 'DD-MON-YYYY') + 35
               THEN  1 + FLOOR ( (week_date - TO_DATE( :start_date, 'DD-MON-YYYY'))
                                         / 7
               ELSE  0
                  END
             , 7
             )          AS week_nbr
, SUM(NET_SALES2)                                                                                                                                                                                                                                                     AS net_sales2
, SUM(BUNS24434 ) BUNS24434
, SUM(PICKELS_AW38) PICKELS_AW38
, SUM(MUSTARD_TB56) MUSTARD_TB56
, SUM(CHICKENHEADS33) CHICKENHEADS33
, SUM(PIECES_SOLD34) PIECES_SOLD34
, SUM(SCRAPS35) SCRAPS35
, SUM(PIECES_UNACCOUNTED) * - 1 PIECES_UNACCOUNTED
   /*--== Head average  net_sales / chickenusage*/
, CASE
      WHEN NVL( SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
      ELSE ROUND(SUM(net_sales2) / ( SUM(ChickenHeads33) / 8 ) , 2)
   END AS Head_average
   /*--=== Efficiency =   (ChickenUsage  - scrappedDiv8 - unaccountedDiv8) / ChickenUsage)  * 100*/
, CASE
      WHEN NVL(SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
      ELSE ROUND((((SUM(ChickenHeads33) / 8 ) - ( SUM(scraps35) / 8 ) - (SUM(pieces_unaccounted) / 8 )) / (SUM(ChickenHeads33) / 8 )) * 100 , 2)
   END AS efficiency
FROM period_data per
WHERE week_DATE BETWEEN TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IY') AND TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IW') + 6 + 7 * 4
GROUP BY  hot_dog_stand_id
,           ROLLUP (
             CASE
               WHEN  week_date >= TO_DATE( :start_date, 'DD-MON-YYYY')
               AND   week_date <  TO_DATE( :start_date, 'DD-MON-YYYY') + 35
               THEN  1 + FLOOR ( (week_date - TO_DATE( :start_date, 'DD-MON-YYYY'))
                                         / 7
               ELSE  0
             END          -- week_nbr
ORDER BY  week_nbr
;Thanks in advance .

Frank Kulash wrote:
Hi,
There's probably a way to get both the year-to-date and the period_to_date totals using ROLLUP, but I don't know what that is.I replaced your WITH statement with
--== ABBREVS: beginning-of-week, period-week-nbr, beginning-of-period, beginning-of-period-last-year
with report_dates as
select '24-AUG-09' gamedate, '239' week_nbr, '24-AUG-09' bow, '25-AUG-08' bow_ly, 9 per_nbr, 1 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '25-AUG-09' gamedate, '240' week_nbr, '24-AUG-09' bow, '25-AUG-08' bow_ly, 9 per_nbr, 1 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '26-AUG-09' gamedate, '241' week_nbr, '24-AUG-09' bow, '25-AUG-08' bow_ly, 9 per_nbr, 1 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '27-AUG-09' gamedate, '242' week_nbr, '24-AUG-09' bow, '25-AUG-08' bow_ly, 9 per_nbr, 1 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '28-AUG-09' gamedate, '243' week_nbr, '24-AUG-09' bow, '25-AUG-08' bow_ly, 9 per_nbr, 1 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '29-AUG-09' gamedate, '244' week_nbr, '24-AUG-09' bow, '25-AUG-08' bow_ly, 9 per_nbr, 1 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '30-AUG-09' gamedate, '245' week_nbr, '24-AUG-09' bow, '25-AUG-08' bow_ly, 9 per_nbr, 1 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '31-AUG-09' gamedate, '246' week_nbr, '31-AUG-09' bow, '01-SEP-08' bow_ly, 9 per_nbr,  2 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '01-SEP-09' gamedate, '247' week_nbr, '31-AUG-09' bow, '01-SEP-08' bow_ly, 9 per_nbr, 2 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '02-SEP-09' gamedate, '248' week_nbr, '31-AUG-09' bow, '01-SEP-08' bow_ly, 9 per_nbr, 2 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '03-SEP-09' gamedate, '249' week_nbr, '31-AUG-09' bow, '01-SEP-08' bow_ly, 9 per_nbr, 2 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '04-SEP-09' gamedate, '250' week_nbr, '31-AUG-09' bow, '01-SEP-08' bow_ly, 9 per_nbr, 2 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '05-SEP-09' gamedate, '251' week_nbr, '31-AUG-09' bow, '01-SEP-08' bow_ly, 9 per_nbr, 2 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '06-SEP-09' gamedate, '252' week_nbr, '31-AUG-09' bow, '01-SEP-08' bow_ly, 9 per_nbr, 2 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '07-SEP-09' gamedate, '253' week_nbr, '07-SEP-09' bow, '08-SEP-08' bow_ly, 9 per_nbr, 3 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '08-SEP-09' gamedate, '254' week_nbr, '07-SEP-09' bow, '08-SEP-08' bow_ly, 9 per_nbr, 3 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '09-SEP-09' gamedate, '255' week_nbr, '07-SEP-09' bow, '08-SEP-08' bow_ly, 9 per_nbr, 3 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '10-SEP-09' gamedate, '256' week_nbr, '07-SEP-09' bow, '08-SEP-08' bow_ly, 9 per_nbr, 3 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '11-SEP-09' gamedate, '257' week_nbr, '07-SEP-09' bow, '08-SEP-08' bow_ly, 9 per_nbr, 3 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '12-SEP-09' gamedate, '258' week_nbr, '07-SEP-09' bow, '08-SEP-08' bow_ly, 9 per_nbr, 3 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '13-SEP-09' gamedate, '259' week_nbr, '07-SEP-09' bow, '08-SEP-08' bow_ly, 9 per_nbr, 3 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '14-SEP-09' gamedate, '260' week_nbr, '14-SEP-09' bow, '15-SEP-08' bow_ly, 9 per_nbr, 4 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '15-SEP-09' gamedate, '261' week_nbr, '14-SEP-09' bow, '15-SEP-08' bow_ly, 9 per_nbr, 4 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '16-SEP-09' gamedate, '262' week_nbr, '14-SEP-09' bow, '15-SEP-08' bow_ly, 9 per_nbr, 4 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '17-SEP-09' gamedate, '263' week_nbr, '14-SEP-09' bow, '15-SEP-08' bow_ly, 9 per_nbr, 4 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '18-SEP-09' gamedate, '264' week_nbr, '14-SEP-09' bow, '15-SEP-08' bow_ly, 9 per_nbr, 4 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '19-SEP-09' gamedate, '265' week_nbr, '14-SEP-09' bow, '15-SEP-08' bow_ly, 9 per_nbr, 4 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '20-SEP-09' gamedate, '266' week_nbr, '14-SEP-09' bow, '15-SEP-08' bow_ly, 9 per_nbr, 4 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '21-SEP-09' gamedate, '267' week_nbr, '21-SEP-09' bow, '22-SEP-08' bow_ly, 9 per_nbr, 5 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '22-SEP-09' gamedate, '268' week_nbr, '21-SEP-09' bow, '22-SEP-08' bow_ly, 9 per_nbr, 5 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '23-SEP-09' gamedate, '269' week_nbr, '21-SEP-09' bow, '22-SEP-08' bow_ly, 9 per_nbr, 5 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '24-SEP-09' gamedate, '270' week_nbr, '21-SEP-09' bow, '22-SEP-08' bow_ly, 9 per_nbr , 5 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '25-SEP-09' gamedate, '271' week_nbr, '21-SEP-09' bow, '22-SEP-08' bow_ly, 9 per_nbr, 5 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '26-SEP-09' gamedate, '272' week_nbr, '21-SEP-09' bow, '22-SEP-08' bow_ly, 9 per_nbr, 5 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '27-SEP-09' gamedate, '273' week_nbr, '21-SEP-09' bow, '22-SEP-08' bow_ly, 9 per_nbr, 5 per_week_nbr, '24-AUG-09' bop, '25-AUG-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                   
select '28-SEP-09' gamedate, '274' week_nbr, '28-SEP-09' bow, '29-SEP-08' bow_ly, 10 per_nbr,  1 per_week_nbr, '28-SEP-09' bop, '29-SEP-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                  
select '29-SEP-09' gamedate, '275' week_nbr, '28-SEP-09' bow, '29-SEP-08' bow_ly, 10 per_nbr,  1 per_week_nbr, '28-SEP-09' bop, '29-SEP-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                  
select '30-SEP-09' gamedate, '276' week_nbr, '28-SEP-09' bow, '29-SEP-08' bow_ly, 10 per_nbr, 1 per_week_nbr, '28-SEP-09' bop, '29-SEP-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual union all                                                                                                                  
select '01-OCT-09' gamedate, '277' week_nbr, '28-SEP-09' bow, '29-SEP-08' bow_ly, 10 per_nbr, 1 per_week_nbr, '28-SEP-09' bop, '29-SEP-08' bop_ly, '29-DEC-08' boy, '29-DEC-07' boy_ly from dual                                                                                                               
)which allowed me to substitute (see the func DDL below):
,  nvl( case
              when week_date < dates.bop then 0
              else fnc_get_per_week_nbr(week_date)
            end
        , 7)  as week_nbrThis is where i got stuck but I'm sure I was on right track
with report_dates as
--=== INSERT WITH CLAUSE FROM ABOVE ===---                                                             
SELECT  HOT_DOG_STAND_ID
         --== when week_date < beginning of period then week nbr = 0 to representing beginning of year to end of previous period
       ,  nvl( case
              when week_date < dates.bop then 0
              else fnc_get_per_week_nbr(week_date)
            end
        , 7)  as week_nbr
, SUM(NET_SALES2)   NET_SALES2                                                                                                                                                                                                                                                  AS net_sales2
, SUM(BUNS24434 ) BUNS24434
, SUM(PICKELS_AW38) PICKELS_AW38
, max(sum(net_sales2))  over partition by(  ??? where week_nbr in (1,2,3,4,5) net_sales2_ptd
, max(sum(BUNS24434))  over partition by(  ??? where week_nbr in (1,2,3,4,5) BUNS24434_ptd
, max(sum(PICKELS_AW38))  over partition by(  ??? where week_nbr in (1,2,3,4,5) PICKELS_AW38_ptd
FROM period_data per
inner join report_dates dates on dates.game_date = TO_DATE( '26-AUG-09' , 'DD-MON-YY')
WHERE week_DATE BETWEEN dates.boy AND to_date(dates.bow, 'dd-mon-yy') + 6
GROUP BY  hot_dog_stand_id
,    ROLLUP (
                case
              when week_date < dates.bop then 0
              else fnc_get_per_week_nbr(week_date)
            end
ORDER BY  week_nbr
;As a footnote, in my live database, reports_tables is a table, so I cleaned up main SELECT with the referenced function:
create or replace FUNCTION fnc_get_per_week_nbr(dte IN date)
RETURN number IS
out_week_nbr  number;
BEGIN
--== ABBREVS: beginning-of-week, period-week-nbr, beginning-of-period, beginning-of-period-last-year
with report_dates as
            ---== Replace with Select statements to have sample data for func ==--                                                                                                         
select per_week_nbr into out_week_nbr from report_dates where game_date =  dte;
     return out_week_nbr;
END fnc_get_per_week_nbr;
Without the correct desired results, I can't be sure if this is right.
Your results were correct, totals and all. Thank you.
There was a lot of unnecessary dividing by 8 going on.
x / 8 = 0 if and only if x = 0, so there's no need to divide by 8 when testing for division by 0.
(a/8) / (b/8) = a / b, so there's no need to divide by 8 at all when computing efficiency.
thanks I had missed that.

Similar Messages

  • Solution for IPS/HA needed.

    Hi,
    I need some help here.
    I have to integrate an IPS into an existent redundant network. This network always has two redundant switch links. There is also a redundant pair of Checkpoint firewalls. I have to implement two ASA/IPS in front of these firewalls and keep the redundancy. I also need to use the transparent mode to reduce the implantation impact, and an active/standby failover mode.
    So I decided to use the following physical topology (ignore the dots):
    sw1--ips1--sw3--fw1
    |....................|
    |....................|
    sw2--ips2--sw4--fw2
    The problem with this topology is the L2 loop and STP. The SPT will block a port to avoid this loop. But the converged topology will have problems.
    If the STP topology is like this one bellow, traffic from a host connect to sw1 to a host connected to sw2 will have to pass both IPS, including the standby unit.
    sw1--ips1--sw3--fw1
    |
    |
    sw2--ips2--sw4--fw2
    On other side, if the STP topology is like this one bellow, traffic from fw1 to fw2 will have to pass both IPS, including the standby unit.
    sw1--ips1--sw3--fw1
    |
    |
    sw2--ips2--sw4--fw2
    Moreover, if the STP topology is like one of the two bellow, I can force the topology to direct traffic to the active IPS. But the STP topology should change, if the active IPS fail.
    sw1--ips1 sw3--fw1
    |.......................|
    |.......................|
    sw2--ips2--sw4--fw2
    sw1--ips1--sw3--fw1
    |......................|
    |......................|
    sw2--ips2 sw4--fw2
    Am I missing anything here? Is there any other solution for HA/IPS?
    Any comment will be appreciated.
    Paulo Roque
    Network Engineer
    SPCBrasil

    Thx Robert.
    I have considered a solution similar to yours, but a question raised from that solution: if I issue a 'no failover active' command to force the standby unit to become active, the STP topology should also be modified to make the traffic pass thru the new active ASA.
    This STP topology change will not be automatic. And even worst, this will never happen in a situation were the ASA fails over by other reason.

  • Need solution for YTD report

    What is a simple solution to reporting on YTD gifts for a series of years. I know there are many ways to do this. I want to avoid unnecessary datatype conversion and have it work on the basis of relative dates.
    The fiscal year starts 6/1 and ends 5/31. The report would ask for an ending date as a parameter. If the parameter is 9/31/07 the ranges for the condition would be:
    gifts between 6/1/03 and 9/31/03 or
    gifts between 6/1/04 and 9/31/04 or
    gifts between 6/1/05 and 9/31/05 or
    gifts between 6/1/06 and 9/31/06 or
    gifts between 6/1/07 and 9/31/07
    If the parameter is 1/31/07 the ranges for the condition would be:
    gifts between 6/1/02 and 1/31/03 or
    gifts between 6/1/03 and 1/31/04 or
    gifts between 6/1/04 and 1/31/05 or
    gifts between 6/1/05 and 1/31/06 or
    gifts between 6/1/06 and 1/31/07
    Thanks for any help

    yeshavanth, pls ask this in reports forum

  • Need solution for multiple Firewire needs

    My new 27" 2011 imac will arrive next Monday. I'm now trying to define and solve all potential hurdles.
    I seek recommendations on how to best solve my need to attach 2 original  firewire cables, into this imac that only comes with 1 firewire 800 input. Both connectors are critical to my  work. One connector will turn hard to the right for about six feet to connect to my Digi02 audio interface. The other cable connects and turns hard to the left for 15 feet to connect to my Epson 2200 art printer. Both of the outboard equipment need the original firewire.
    I have considered daisy chaining the audio interface and the printer. Except they are on opposite sides of my studio, and I prefer NOT to use a 25 foot firewire cable between such critical peices of hardware.
    A better possibility may be a firewire hub, although it will probably also need adaptors for the different versions of firewire i need. That seems rather inelegant. Another possibility would be to get one USB to firewire adaptor and one firewire to 800 adaptor. Do these USB to firewire adaptors work OK? 
    Anyway, which of these methods would you recommend as my best choice? Are there other choices i haven't mentioned here?

    The guy is totally correctin his review.
    That is how FireWire works. The FireWire bus will run only as fast as the slowest device on the bus. So as soon as plug in a FW400 device, everything is then clocked down to 400FW.
    If you need to have both FW800 and FW400 devices running at their native speeds you need two FW busses each with their own controller.
    Because of the limited expansion capability of the iMac, I don't see any way for you to get around this limitation.
    If you get a Mac Pro then you could use a FW PCIe card for the second bus and controller.
    Allan

  • I need a one-lens solution for my photo needs on high speed Corvette Races. Will 35-350L do?

    I need one lens to carry on my 1D during long road rallies with the Corvette Race club.  Would the 35-350L be a good canditate?
    Solved!
    Go to Solution.

    You have a 1D ?     Or do you have a later 1 D seires camera?  
     I have used and still use a 1D.  It would not be my first choice, or 2nd, or 3rd, for motorsports shooting with whatever lens.
     At 4MP you are going to be really handicaped in any sort of enlargements.
    The 1D is a fantastic camera and at one time the best camera in the world with a, at the time, insane price of around 8 grand.
    If you do indeed have a 1D, I would search for a later 1 series and the best buy right now is a 1D Mk III.
    Than the addition of the EF 35-350mm f3.5-5.6, or better yet the EF 28-350mm f3.5-5.6 should work well.
    With a lot of practice as suggested above.
    EOS 1Ds Mk III, EOS 1D Mk IV EF 50mm f1.2 L, EF 24-70mm f2.8 L,
    EF 70-200mm f2.8 L IS II, Sigma 120-300mm f2.8 EX APO
    Photoshop CS6, ACR 8.7, Lightroom 5.7

  • Does oracle have a solution for what i need?

    Can anyone help because i am confused about Oracles offerings!
    In my organisation where use Staffware v9 (now TIBCO, and not the iprocess engine) as the workflow backbone. Relatively simple process maps with background steps calling SQL code to perfom updates and return case data variable settings and foreground steps mapping to oracle forms. v9 is client server with limited API set so uses DDL calls with parameter passing and timers to communicate, but used the better API interfaces in the past. Currently on Oracle 10g at the moment, plans to go to 11g, but not holding my breath on this as we would need some infrastructure changes.
    The client server nature of the TIBCO product and the fact that it uses flat files for transactional processing means that it is no longer suitable for our needs, and i want to replace it with an alternative. As we are an oracle shop, a suitable oracle product would be ideal, but unlike the (admittedly sparse) documentation on the old oracle workflow, the new stuff confuses the hell out of me as it seems so wrapped up with SOA concepts (something we are NOT interested in at the moment) and with the addition of some what conflicting BPM and BAM tools as well, there also seems no clear direction. TIBCO also want a lot of money to go to the new product
    What i need is a tool to do the following
    1) define users, access levels, group work queues with membership and supervisors
    2) graphical process designer that can define PL/SQL interface steps, make available foreground tasks in the appropriate queues with APIs to access from the forms environment
    3) workflow process management objects like
    - decision based process routing on rule or data values
    - sub procedure definitions
    - external event APIs to control flow and update case data
    - branching, joining and wait joins
    - rules engines and dynamic process definition nice to have, but not critical
    4) operational API for case starting, event issue, audit trail access etc.
    5) APIs and repository held in the database
    6) externally accessible database structure (ie: makes sense in sql) for reporting/management
    I have worked with workflow systems for way too many years (years ago i was even on the Staffware advisory panel) so well up on how these systems work, and think that all of the above is pretty basic stuff, but (maybe just getting old) i cannot see how oracle are meeting what i see as the basics
    any ideas?

    I agree workflow is not SOA (Service Orientated Architecture). Oracle's strategic direction is BPEL / BPM, and Oracle workflow is moving to end of life.
    BPEL is part of SOA Suite but you do have the option to buy standalone, it does have a prerequisite of weblogic suite though.
    Although Oracle markets the product SOA Suite it does not mean you you have to develop a SOA architecture, you can still develop point to point interfaces as you do in workflow. SOA Suite just enables you get more reuse out of your existing systems, and future developments. If you want you can keep you workflow develop as it and integrate BPEL / SOA Suite with it.
    Im sure you are very skilled in workflow but these skills are becomming very hard to find. They require strong PL/SQL skills and typically don't work with any other application or database without doing some customization. The fact that there is limited documentation shows that it is going to be difficult to upskill developers.
    For the functionality Oracle provides in its BPM and SOA Suite I would say it is cheap, especially against our competitors. Also the more you buy the cheaper it gets.
    cheers
    James

  • Buy second hand iPhone ........... i have apple id of previous owner but no password ... now the phone is in icloud activation mode . any solution for this.

    i buy second hand iPhone from Olx ........... i have apple id of previous owner but no password ...
    now the phone is in icloud activation mode . any solution for this.
    totally wastage of money , if there is no solution .
    for security purpose this icloud activation is Good ............

    Read this
    http://support.apple.com/kb/TS4515?viewlocale=en_US&locale=en_US

  • Does anyone know of a good digital asset management software solution for cataloging InDesign files?

    Hi all,
    I am coming to this forum with this question because this amazing community of design professionals has helped me SO MUCH over the past few years...so I come to you for help once again as I search for a digital asset management solution that will also catalog InDesign files. I first used to use Canto Cumulus many years back, and then used Portfolio Standalone but both of those had their issues and are now discontinued. I am now looking for something else. It is for my small business and needs to handle all of my InDesign files and all associated artwork (I have a HUGE library of files....this also includes all of my image files, pdfs, etc.).
    Extensis Portfolio Server is just WAY overkill and WAY too expensive for what I need. Also, the cheapest option (which is $1,999) only handles "thousands of files" whereas I have tens of thousands. I am also not interested in storing my "asset catalog" within the cloud...I just want it stored locally.
    Please please can someone help point me in the right direction? I have been scratching my head searching for something...there is SO MUCH out there...the majority of which won't properly handle InDesign files as well, which is a NECESSITY.
    Thank you so much as always,
    Christine

    Purple_Jim, for some reason I just lost my new reply, so am writing again:)
    I just checked out the program and one CAN easily update the database when changes are made to the volume(s) as files are added/removed/renamed/moved, etc. This is GREAT!! I am busy trying it out and it is WONDERFUL and EXACTLY what I need! And it is SO SPEEDY too...I LOVE it!
    I just had to contact their support tho' as it doesn't seem to want to add in all of the images. It APPEARS to be adding them but not all of the folders are showing up. If I can get this issue sorted out then this program would be IDEAL:) It's great to know that you haven't had any issues:) That gives me hope as this program looks PERFECT!!
    Thank you so so much for letting me know about it:)
    **UPDATE**
    In CASE you can shed any light on my issue...
    I just did some more testing and it seems that the problem occurs if/after I hit “STOP” when the volume is being scanned. Once I try to update the volume after that so that I can continue adding images, then it seems that nothing is added to the directory in Tri_CATALOG after the point when I chose to hit “STOP”.
    It does not seem to be cataloging everything:( I just tried adding a new volume but it appears to have stopped adding images to the database even tho’ it SEEMS as if new items are still being added in the “Scan Volume window”.
    Here is an example: The image below labeled “469-00625” appears to have been added to the “Clients/Ascot Supply Corp./Buyer’s Guide/2014 Buyer’s Guide/Archive/z_buyer’s guide image library_jpg/06_valve hardware/JPEG” folder but when I do a search for the image it cannot be located, and this folder also does not appear in the catalog directory (second screenshot below). No matter how many times I try to update the volume, the number of images for the “Clients” folder below remains at 811 pictures (as if it has stopped scanning, even tho’ new ones are still being added) and I am not able to add anything else. The Tri_CATALOG database appears to have stopped adding images after the “2011 Buyer’s Guide” folder below even tho’ there are still several new folders still need to be added….see third screenshot for ACTUAL directory on the volume.
    From Tri_CATALOG: (Won’t add anything else below “2011 Buyer’s Guide"
    Screenshot of ACTUAL directory from volume I am trying to scan into Tri_CATALOG:

  • Need help getting YTD total

    I've got a period to date report with following columns:
    week1 tots, week2 tots, week3 tots, week4 tots, week5 tot, period-to-date tots, year-to-date tots
    I have a SELECT statement which totals data for the entire year and separates current period totals
    by grouping on the week_nbr . Any date between beginning of year and the end of the previous period will be week 0
    The Select statement retursn 6 rows: 1 for each week in period and one with week_nbr = 0 which represents the totals from the beginning of year
    to the end of the previous period.
    the select statement returns the data correctly . I need help getting the YTD total for (weeks 1 - 5) + (totals for week 0) for each column.
    This means that I will have a 7th record containing the YTD totals. ( I am not concerned with the PTD totals)
    I tried sum by partition but complex decode statement gave me problems.
      CREATE TABLE PERIOD_DATA
       (     "HOT_DOG_STAND_ID" NUMBER NOT NULL ENABLE,
         "WEEK_DATE" DATE,
         "NET_SALES2" NUMBER,
         "BUNS24434" NUMBER,
         "PICKELS_AW38" NUMBER,
         "MUSTARD_TB56" NUMBER,
         "CHICKENHEADS33" NUMBER,
         "PIECES_SOLD34" NUMBER,
         "SCRAPS35" NUMBER,
         "PIECES_UNACCOUNTED" NUMBER
    REM INSERTING into PERIOD_DATA
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('29-DEC-08','DD-MON-RR HH.MI.SSXFF AM'),14301.39,13951.26,3431.13,0,3680,2484,378,818);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('05-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),14651.37,14651.37,3249.55,0,3200,2419,505,276);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('12-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),14169.89,14169.89,2463.53,0,3136,2080,474,582);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('19-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),15864.46,15864.46,3245.49,0,3472,2764,475,233);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('26-JAN-09','DD-MON-RR HH.MI.SSXFF AM'),15961.2,15916.23,3395.51,0,3648,2838,392,418);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('02-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),19066.4,19066.4,4165.07,0,4336,3682,333,321);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('09-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),18415.74,18415.74,4024.74,0,4032,3365,482,185);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('16-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),18014,17849,3486.33,0,3840,3238,374,228);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('23-FEB-09','DD-MON-RR HH.MI.SSXFF AM'),18671.09,18626.12,3729.42,0,3888,2970,353,565);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('02-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),17636,17636,3815,0,3424,2840,490,94);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('09-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),17235.52,17145.58,3897.42,0,3504,2928,421,155);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('16-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),15989.27,15989.27,3372.95,0,3728,3051,369,308);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('23-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),19067.69,18960.41,4152.6,0,4048,3293,442,313);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('30-MAR-09','DD-MON-RR HH.MI.SSXFF AM'),18717.99,18717.99,3923.69,0,4408,3219,593,596);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('06-APR-09','DD-MON-RR HH.MI.SSXFF AM'),17335.16,17335.16,3769.08,0,3928,2997,514,417);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('13-APR-09','DD-MON-RR HH.MI.SSXFF AM'),18967.39,18967.39,4157.76,0,4144,2991,527,626);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('20-APR-09','DD-MON-RR HH.MI.SSXFF AM'),23090.88,23090.88,4427.96,0,5544,4493,560,491);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('27-APR-09','DD-MON-RR HH.MI.SSXFF AM'),24197.98,24132.99,4248.66,0,6680,5190,606,884);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('04-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),20202.21,20137.22,3714.68,0,7052,6170,422,460);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('11-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),18514.48,18514.48,3266.06,0,5508,4178,571,759);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('18-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),18678.68,18678.68,3814.07,0,5824,4345,633,846);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('25-MAY-09','DD-MON-RR HH.MI.SSXFF AM'),17937.18,17937.18,3051.52,0,4844,4986,529,-671);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('01-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17445.75,17445.75,3079.91,0,5028,4810,656,-438);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('08-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17327.88,17327.88,3263.29,0,6112,4674,672,766);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('15-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17241.72,16937.33,3328.27,0,5792,4490,567,735);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('22-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),16625.83,16625.83,3485.18,0,5408,4319,761,328);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('29-JUN-09','DD-MON-RR HH.MI.SSXFF AM'),17002.84,17002.84,3091.09,0,5664,4369,544,751);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('06-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),16339.19,16274.2,3075.3,0,4784,3440,697,647);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('13-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),17165.12,16885.14,3458.03,0,4320,3296,640,384);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('20-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),17029.77,16899.79,3198.91,0,4448,3449,645,354);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('27-JUL-09','DD-MON-RR HH.MI.SSXFF AM'),16596.89,16596.89,3015.54,0,4624,3288,665,671);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('03-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),16468.58,16468.58,2981.35,0,2224,3495,564,-1835);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('10-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),18625.48,18550.5,3524.44,0,4856,3482,578,796);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('17-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),24538.54,24323.55,5580.71,0,5260,3771,608,881);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('24-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),18081.37,18081.37,3533.45,0,5980,3080,553,2347);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('31-AUG-09','DD-MON-RR HH.MI.SSXFF AM'),17183.25,17183.25,3487.12,0,2544,3262,615,-1333);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('07-SEP-09','DD-MON-RR HH.MI.SSXFF AM'),17688.41,17575.29,3424.17,0,4800,3480,591,729);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('14-SEP-09','DD-MON-RR HH.MI.SSXFF AM'),18211.29,18211.29,3806.32,0,3968,3104,527,337);
    Insert into PERIOD_DATA (HOT_DOG_STAND_ID,WEEK_DATE,NET_SALES2,BUNS24434,PICKELS_AW38,MUSTARD_TB56,CHICKENHEADS33,PIECES_SOLD34,SCRAPS35,PIECES_UNACCOUNTED) values (141,to_timestamp('21-SEP-09','DD-MON-RR HH.MI.SSXFF AM'),16809.21,16744.22,3014.61,0,4128,3124,710,294);
    SELECT HOT_DOG_STAND_ID
    , DECODE(TRUNC(week_date , 'iw') ,
             to_date('24-AUG-09' , 'dd-mon-rr') , 1 ,
             to_date('24-AUG-09' , 'dd-mon-rr') + 7 , 2 ,
             to_date('24-AUG-09' , 'dd-mon-rr') + 14 , 3 ,
             to_date('24-AUG-09' , 'dd-mon-rr') + 21 , 4 ,
             to_date('24-AUG-09' , 'dd-mon-rr') + 28 , 5 , 0) AS week_nbr
    , SUM(NET_SALES2)                                                                                                                                                                                                                                                     AS net_sales2
    , SUM(BUNS24434 ) BUNS24434
    , SUM(PICKELS_AW38) PICKELS_AW38
    , SUM(MUSTARD_TB56) MUSTARD_TB56
    , SUM(CHICKENHEADS33) CHICKENHEADS33
    , SUM(PIECES_SOLD34) PIECES_SOLD34
    , SUM(SCRAPS35) SCRAPS35
    , SUM(PIECES_UNACCOUNTED) * - 1 PIECES_UNACCOUNTED
       /*--== Head average  net_sales / chickenusage*/
    , CASE
          WHEN NVL( SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
          ELSE ROUND(SUM(net_sales2) / ( SUM(ChickenHeads33) / 8 ) , 2)
       END AS Head_average
       /*--=== Efficiency =   (ChickenUsage  - scrappedDiv8 - unaccountedDiv8) / ChickenUsage)  * 100*/
    , CASE
          WHEN NVL(SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
          ELSE ROUND((((SUM(ChickenHeads33) / 8 ) - ( SUM(scraps35) / 8 ) - (SUM(pieces_unaccounted) / 8 )) / (SUM(ChickenHeads33) / 8 )) * 100 , 2)
       END AS efficiency
    FROM period_data per
    WHERE week_DATE BETWEEN TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IY') AND TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IW') + 6 + 7 * 4
    GROUP BY hot_dog_stand_id
    , DECODE(TRUNC(week_date , 'iw') ,
          to_date('24-AUG-09' , 'dd-mon-rr') , 1 ,
          to_date('24-AUG-09' , 'dd-mon-rr') + 7 , 2 ,
          to_date('24-AUG-09' , 'dd-mon-rr') + 14 , 3 ,
          to_date('24-AUG-09' , 'dd-mon-rr') + 21 , 4 ,
          to_date('24-AUG-09' , 'dd-mon-rr') + 28 , 5 ,
          0)
    ORDER BY DECODE(TRUNC(week_date , 'iw') , to_date('24-AUG-09' , 'dd-mon-rr') , 1 , to_date('24-AUG-09' , 'dd-mon-rr') + 7 , 2 , to_date('24-AUG-09' , 'dd-mon-rr') + 14 , 3 , to_date('24-AUG-09' , 'dd-mon-rr') + 21 , 4 , to_date('24-AUG-09' , 'dd-mon-rr') + 28 , 5 , 0);The expected results will be:
    HOT_DOG_STAND_ID       WEEK_NBR               NET_SALES2             BUNS24434              PICKELS_AW38           MUSTARD_TB56           CHICKENHEADS33         PIECES_SOLD34          SCRAPS35               PIECES_UNACCOUNTED     HEAD_AVERAGE           EFFICIENCY            
    141                    7                      697067.09              694887.4               139149.91              0                      175808                 139454                 21036                  15318                  31.72                  79.32                  You can get these dame results by running endpot-to-endpoint query:
    SELECT  HOT_DOG_STAND_ID
         , max(7) as week_nbr
         ,sum(NET_SALES2)      net_sales2
          ,sum(BUNS24434 )        BUNS24434
          ,sum(PICKELS_AW38)      PICKELS_AW38
          ,sum(MUSTARD_TB56)     MUSTARD_TB56
          ,sum(CHICKENHEADS33)   CHICKENHEADS33
          ,sum(PIECES_SOLD34)    PIECES_SOLD34
          ,sum(SCRAPS35)         SCRAPS35
          ,sum(PIECES_UNACCOUNTED)   PIECES_UNACCOUNTED
        ---===== Copied code from outer query
              --==  net_sales / chickenusage 
                      ,   CASE
                             WHEN NVL( sum(ChickenHeads33) / 8    ,0)  = 0 then 0
                             ELSE ROUND(sum(net_sales2)/   ( sum(ChickenHeads33) / 8    ) , 2)
                          END as Head_average
                        --=== Efficiency =   (ChickenUsage  - scrappedDiv8 - unaccountedDiv8) / ChickenUsage)  * 100
                        ,   CASE
                                  WHEN NVL(sum(ChickenHeads33) / 8    ,0)  = 0 then 0
                                  ELSE   ROUND((((sum(ChickenHeads33) / 8 )  - ( sum(scraps35) / 8 ) - (sum(pieces_unaccounted) / 8 )) / (sum(ChickenHeads33) / 8 )) * 100, 2)
                          END as efficiency  
    from period_data
    WHERE week_DATE BETWEEN TRUNC(TO_DATE( '24-AUG-09' ,'DD-MON-YY'), 'IY') AND TO_DATE( '27-sep-09' ,'DD-MON-YY')
    group by hot_dog_stand_id;Thanks In Advance

    Hi,
    Welcome to the forum!
    Thanks for posting the CREATE TABLE and INSERT statements; that's very helpful. You could teach something to some people who have been using this forum for years (except that nobody can teach them).
    user12335325 wrote:
    The expected results will be:
    HOT_DOG_STAND_ID       WEEK_NBR               NET_SALES2             BUNS24434              PICKELS_AW38           MUSTARD_TB56           CHICKENHEADS33         PIECES_SOLD34          SCRAPS35               PIECES_UNACCOUNTED     HEAD_AVERAGE           EFFICIENCY            
    141                    7                      697067.09              694887.4               139149.91              0                      175808                 139454                 21036                  15318                  31.72                  79.32                 
    Do you mean the expected results will include the row above, and that the results will be this row along with the 6 rows you're already getting? (If you wanted just that one row, I suppose you would just run your second query.)
    That sound like a job for ROLLUP.
    VARIABLE   start_date     VARCHAR2 (11);
    EXEC         :start_date  := '24-AUG-2009';
         SELECT  HOT_DOG_STAND_ID
         ,      NVL (CASE
                   WHEN  week_date >= TO_DATE( :start_date, 'DD-MON-YYYY')
                   AND   week_date <  TO_DATE( :start_date, 'DD-MON-YYYY') + 35
                   THEN  1 + FLOOR ( (week_date - TO_DATE( :start_date, 'DD-MON-YYYY'))
                                             / 7
                   ELSE  0
                      END
                 , 7
                 )          AS week_nbr
    , SUM(NET_SALES2)                                                                                                                                                                                                                                                     AS net_sales2
    , SUM(BUNS24434 ) BUNS24434
    , SUM(PICKELS_AW38) PICKELS_AW38
    , SUM(MUSTARD_TB56) MUSTARD_TB56
    , SUM(CHICKENHEADS33) CHICKENHEADS33
    , SUM(PIECES_SOLD34) PIECES_SOLD34
    , SUM(SCRAPS35) SCRAPS35
    , SUM(PIECES_UNACCOUNTED) * - 1 PIECES_UNACCOUNTED
       /*--== Head average  net_sales / chickenusage*/
    , CASE
          WHEN NVL( SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
          ELSE ROUND(SUM(net_sales2) / ( SUM(ChickenHeads33) / 8 ) , 2)
       END AS Head_average
       /*--=== Efficiency =   (ChickenUsage  - scrappedDiv8 - unaccountedDiv8) / ChickenUsage)  * 100*/
    , CASE
          WHEN NVL(SUM(ChickenHeads33) / 8 , 0) = 0 THEN 0
          ELSE ROUND((((SUM(ChickenHeads33) / 8 ) - ( SUM(scraps35) / 8 ) - (SUM(pieces_unaccounted) / 8 )) / (SUM(ChickenHeads33) / 8 )) * 100 , 2)
       END AS efficiency
    FROM period_data per
    WHERE week_DATE BETWEEN TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IY') AND TRUNC(TO_DATE( '24-AUG-09' , 'DD-MON-YY') , 'IW') + 6 + 7 * 4
    GROUP BY  hot_dog_stand_id
    ,           ROLLUP (
                 CASE
                   WHEN  week_date >= TO_DATE( :start_date, 'DD-MON-YYYY')
                   AND   week_date <  TO_DATE( :start_date, 'DD-MON-YYYY') + 35
                   THEN  1 + FLOOR ( (week_date - TO_DATE( :start_date, 'DD-MON-YYYY'))
                                             / 7
                   ELSE  0
                 END          -- week_nbr
    ORDER BY  week_nbr
    ;Notice I simplified the computation of week_nbr.
    Some other people have asked questions about hot dog stands recently.
    I'm curious; is this from a course? If so, where? What is the textbook (if any)?
    Thanks.

  • .xmp not recognized by Bridge CS 5.5.  All previous solutions here not working for me.  Please help.

    First of all, this issue has existed for me since CS4.
    When I load an .nef file into photoshop from bridge, it opens in camera raw.  Once I edit that photo and send it to photoshop, an .xmp file is created and those changes should show up in bridge, but they don't.  Looking in my folder of raw files, I can see the .xmp file.
    To make matters more confusing, this only occurs with one of my two cameras.  I have two seemingly identical Nikon D300s DSLRs.  One with a 14mm and one with a 70-200 zoom.  Bridge's issue with failing to recognize .xmp files only occurs with folders that contain photos shot with the camera with the zoom lens.
    I have exhausted all of the solutions I have been able to find on this forum: telling my mac to open .xmp files with Bridge, telling Bridge to always use high quality thumbnails with 100% preview.
    Can someone please help?

    I have exhausted all of the solutions I have been able to find on this forum: telling my mac to open .xmp files with Bridge, telling Bridge to always use high quality thumbnails with 100% preview.
    For several years ago I decided to convert all my CR2 Raw files (I use Canon) to DNG upon ingestion of the files. Not only is DNG an open standard and therefor will it be long supported but mainly because I was growing mad of all the side car XMP files. DNG stores the XMP info into the file itself. No more hidden files no more mistakes in copy files leaving XMP lost in a folder, etc. etc.
    Although it is strange one dSLR has this problem and the other not I don't think it is lens related as Curt kindly suggested. To my knowledge lenses affect the EXIF data and Bridge creates the XMP Data as a sidecar file (by default selected in the Camera Raw preferences) with rating, labeling and ACR settings.
    By default Bridge also does not show hidden items (that XMP files are). Could you double check with Raw files from both cameras next to each other and after having altered them both in ACR (i.e. plus 2 in exposure to make a real difference) and in the Bridge menu view show hidden files (sort Bridge on filename for easy viewing).
    And if one is not showing the altered result could you click on it and with right mouse click menu check 'purge cache for selection and see if this changes things.  (If the changes are there in PS as Curt already asked this might also help)
    Could you also convert both files to DNG (Adobe has a free DNG converter for download (see also this link or Google it):
    http://www.adobe.com/products/photoshop/extend.displayTab2.html
    And could you provide a short summary of the solutions you already tried (all previous solutions is a little vague :-) )
    Having set XMP to open in Bridge is not important, XMP is not meant to be opened by the user, Bridge uses it to read and write but other apps also. For instance I just tested on an old CR2 file with XMP and by default it opens in Adobe Photoshop Elements (also on my system like CS5 Suite, Aperture and Lightroom) as I discovered using the get info command. Bridge wasn't even on the list for possible opening options :-)
    Also 100 % preview will not help, it just slows things down very much because the cache needs much more time to build and the cache file will grow to huge proportions...
    Only if you want to use to compare all files at 100 % you might benefit from that setting.

  • TA24002 My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know which erase option would be the best solution for this problem.

    My 500 GB can't verify nor repair. I have photoshop work that I need to recover. I would like to know what option would be the best solution for this problem?

    You appear to have two issues: 1) a hard drive that is not working properly and 2) files you wish to recover.
    Re 1) you need to answer Kappy's questions.
    Re 2) does the drive load and can you see your photo files? If so can you copy them to another drive?
    Do you not have a backup of the photo files?

  • I have changed my Apple ID name and I want to change it on iCloud, however I am not able to delete the previous account because I need to turn off the Find my iPhone - and for that I need to log in with the old name and that is not working. Help anyone?

    I have changed my Apple ID name and I want to change it on iCloud, however I am not able to delete the previous account because I need to turn off the Find my iPhone - and for that I need to log in with the old name and that is not working. Help anyone?

    Hey tulgan,
    This link will provide information on what to do after you change your Apple ID:
    Apple ID: What to do after you change your Apple ID
    http://support.apple.com/kb/HT5796
    Welcome to Apple Support Communities!
    Take care,
    Delgadoh

  • Need solution for the following sync error: "iTunes could not sync calendars to the iPad "iPad name" because an error occurred while sending data from the iPad"

    Need solution for the following sync error: "iTunes could not sync calendars to the iPad "iPad name" because an error occurred while sending data from the iPad"

    I want to add that I deleted all the old back-ups and created a new back-up without any issues except sync problem.

  • Is Oracle Text the right solution for this need of a specific search!

    Hi ,
    We are on Oracle 11.2.0.2 on Solaris 10. We have the need to be able to do search on data that are having diacritical marks and we should be able to do the serach ignoring this diacritical marks. That is the requirement. Now I got to hear that Oracle Text has a preference called BASIC_LEXER which can bypass the diacritical marks and so solely due to this feature I implemented Oracle Text and just for this diacritical search and no other need.
    I mean I set up preference like this:
      ctxsys.ctx_ddl.create_preference ('cust_lexer', 'BASIC_LEXER');
      ctxsys.ctx_ddl.set_attribute ('cust_lexer', 'base_letter', 'YES'); -- removes diacritics
    With this I set up like this:
    CREATE TABLE TEXT_TEST
      NAME  VARCHAR2(255 BYTE)
    --created Oracle Text index
    CREATE INDEX TEXT_TEST_IDX1 ON TEXT_TEST
    (NAME)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('LEXER cust_lexer WORDLIST cust_wl SYNC (ON COMMIT)');
    --sample data to illustrate the problem
    Insert into TEXT_TEST
       (NAME)
    Values
       ('muller');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('müller');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('MULLER');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('MÜLLER');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('PAUL HERNANDEZ');
    Insert into TEXT_TEST
       (NAME)
    Values
       ('CHRISTOPHER Phil');
    COMMIT;
    --Now there is an alternative solution that is there,  instead of thee Oracle Text which is just a plain function given below (and it seems to work neat for my simple need of removing diacritical characters effect in search)
    --I need to evaluate which is better given my specific needs -the function below or Oracle Text.
    CREATE OR REPLACE FUNCTION remove_dia(p_value IN VARCHAR2, p_doUpper IN VARCHAR2 := 'Y')
    RETURN VARCHAR2 DETERMINISTIC
    IS
    OUTPUT_STR VARCHAR2(4000);
    begin
    IF (p_doUpper = 'Y') THEN
       OUTPUT_STR := UPPER(p_value);
    ELSE
       OUTPUT_STR := p_value;
    END IF;
    OUTPUT_STR := TRANSLATE(OUTPUT_STR,'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ', 'AAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
    RETURN (OUTPUT_STR);
    end;
    --now I query for which name stats with  a P%:
    --Below query gets me unexpected result of one row as I am using Oracle Text where each word is parsed for search using CONTAINS...
    SQL> select * from text_test where contains(name,'P%')>0;
    NAME
    PAUL HERNANDEZ
    CHRISTOPHER Phil
    --Below query gets me the right and expected result of one row...
    SQL> select * from text_test where name like 'P%';
    NAME
    PAUL HERNANDEZ
    --Below query gets me the right and expected result of one row...
    SQL>  select * from text_test where remove_dia(name) like remove_dia('P%');
    NAME
    PAUL HERNANDEZMy entire need was only to be able to do a search that bypasses diacritical characters. To implement Oracle Text for that reason, I am wondering if that was the right choice! More so when I am now finding that the functionality of LIKE is not available in Oracle Text - the Oracle text search are based on tokens or words and they are different from output of the LIKE operator. So may be should I have just used a simple function like below and used that for my purpose instead of using Oracle Text:
    This function (remove_dia) just removes the diacritical characters and may be for my need this is all that is needed. Can someone help to review that given my need I am better of not using Oracle Text? I need to continue using the functionality of Like operator and also need to bypass diacritical characters so the simple function that I have meets my need whereas Oracle Text causes a change in behaviour of search queries.
    Thanks,
    OrauserN

    If all you need is LIKE functionality and you do not need any of the complex search capabilities of Oracle Text, then I would not use Oracle Text. I would create a function-based index on your name column that uses your function that removes the diacritical marks, so that your searches will be faster. Please see the demonstration below.
    SCOTT@orcl_11gR2> CREATE TABLE TEXT_TEST
      2    (NAME  VARCHAR2(255 BYTE))
      3  /
    Table created.
    SCOTT@orcl_11gR2> Insert all
      2  into TEXT_TEST (NAME) Values ('muller')
      3  into TEXT_TEST (NAME) Values ('müller')
      4  into TEXT_TEST (NAME) Values ('MULLER')
      5  into TEXT_TEST (NAME) Values ('MÜLLER')
      6  into TEXT_TEST (NAME) Values ('PAUL HERNANDEZ')
      7  into TEXT_TEST (NAME) Values ('CHRISTOPHER Phil')
      8  select * from dual
      9  /
    6 rows created.
    SCOTT@orcl_11gR2> CREATE OR REPLACE FUNCTION remove_dia
      2    (p_value   IN VARCHAR2,
      3       p_doUpper IN VARCHAR2 := 'Y')
      4    RETURN VARCHAR2 DETERMINISTIC
      5  IS
      6    OUTPUT_STR VARCHAR2(4000);
      7  begin
      8    IF (p_doUpper = 'Y') THEN
      9        OUTPUT_STR := UPPER(p_value);
    10    ELSE
    11        OUTPUT_STR := p_value;
    12    END IF;
    13    RETURN
    14        TRANSLATE
    15          (OUTPUT_STR,
    16           'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ',
    17           'AAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy');
    18  end;
    19  /
    Function created.
    SCOTT@orcl_11gR2> show errors
    No errors.
    SCOTT@orcl_11gR2> CREATE INDEX text_test_remove_dia_name
      2  ON text_test (remove_dia (name))
      3  /
    Index created.
    SCOTT@orcl_11gR2> set autotrace on explain
    SCOTT@orcl_11gR2> select * from text_test
      2  where  remove_dia (name) like remove_dia ('mü%')
      3  /
    NAME
    muller
    müller
    MULLER
    MÜLLER
    4 rows selected.
    Execution Plan
    Plan hash value: 3139591283
    | Id  | Operation                   | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                           |     1 |  2131 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXT_TEST                 |     1 |  2131 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | TEXT_TEST_REMOVE_DIA_NAME |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('mü%'))
           filter("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('mü%'))
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2> select * from text_test
      2  where  remove_dia (name) like remove_dia ('P%')
      3  /
    NAME
    PAUL HERNANDEZ
    1 row selected.
    Execution Plan
    Plan hash value: 3139591283
    | Id  | Operation                   | Name                      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                           |     1 |  2131 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXT_TEST                 |     1 |  2131 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | TEXT_TEST_REMOVE_DIA_NAME |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('P%'))
           filter("SCOTT"."REMOVE_DIA"("NAME") LIKE "REMOVE_DIA"('P%'))
    Note
       - dynamic sampling used for this statement (level=2)
    SCOTT@orcl_11gR2>

  • Need Solution for iWeb/QuickTime viewing problem in IE 6 for Windows

    When viewing an iWeb page in IE 6 for Windows with a background picture and a QuickTime movie embeded, the QT movie frame will "smear" when the page is scrolled. More specifically, The QT movie frame will not lock into its proper position as long as the page has a background picture selected in iWeb when viewing w/ IE 6 for Windows. Does anyone know of a solution for this? Does this problem still exist w/ later versions of IE for Windows?
    By the way, if you don't already know this, changing the Page Background setting back to the default of 'Color Fill' in iWeb and republishing will not correct the problem once a background picture is selected for a page. You have to set the Page Background setting to 'None' and republish. The movie frame will then be locked into place when scrolling the page in IE 6 for Windows.
    MBP 17in (1 GB RAM), PB G4 15in, PB G4 12in, iMac G3   Mac OS X (10.4.7)   Loyal to Apple since the Apple ][+

    Someone else posted that you may have to remove the image altogether, publish, then place the replacement image. The images for the background of my newest pages use this as a tiled background successfully.
    http://web.mac.com/makentosh/iWeb/tipsfromtheiceberg/Images/background.jpg
    I'm not sure how well tiling would work on your page though since it would begin to repeat vertically when you don't want it to (for me, tiling is exactly what I needed).

Maybe you are looking for