174: a.inventory_item_id,
175: SUM( DECODE(a.transfer_type, 'IN', a.common_quantity ,-a.common_quantity) ) sales_qty,
176: SUM( DECODE(a.transfer_type, 'IN', a.common_amount ,-a.common_amount) ) sales_amt
177: from ozf_sales_transactions_all a,
178: ozf_time_day b
179: where a.transaction_date = b.report_date
180: and a.error_flag = 'N'
181: and a.source_code = 'OM'
182: group by
195: a.inventory_item_id,
196: SUM( DECODE(a.transfer_type, 'IN', a.common_quantity , -a.common_quantity) ) sales_qty,
197: SUM( DECODE(a.transfer_type, 'IN', a.common_amount, -a.common_amount) ) sales_amt
198: from ozf_sales_transactions_all a,
199: ozf_time_day b
200: where a.transaction_date = b.report_date
201: and a.error_flag = 'N'
202: and a.source_code = 'OM'
203: group by
216: a.inventory_item_id,
217: SUM( DECODE(a.transfer_type, 'IN', a.common_quantity, -a.common_quantity) ) sales_qty,
218: SUM( DECODE(a.transfer_type, 'IN', a.common_amount, -a.common_amount) ) sales_amt
219: from ozf_sales_transactions_all a,
220: ozf_time_day b
221: where a.transaction_date = b.report_date
222: and a.error_flag = 'N'
223: and a.source_code = 'OM'
224: group by
237: a.inventory_item_id,
238: SUM( DECODE(a.transfer_type, 'IN',a.common_quantity,-a.common_quantity) ) sales_qty,
239: SUM( DECODE(a.transfer_type, 'IN',a.common_amount, -a.common_amount) ) sales_amt
240: from ozf_sales_transactions_all a,
241: ozf_time_day b
242: where a.transaction_date = b.report_date
243: and a.error_flag = 'N'
244: and a.source_code = 'OM'
245: group by
258: a.inventory_item_id,
259: SUM( DECODE(a.transfer_type, 'IN', a.common_quantity, -a.common_quantity) ) sales_qty,
260: SUM( DECODE(a.transfer_type, 'IN', a.common_amount , -a.common_amount) ) sales_amt
261: from ozf_sales_transactions_all a,
262: ozf_time_day b
263: where a.transaction_date = b.report_date
264: and a.error_flag = 'N'
265: and a.source_code = 'OM'
266: group by
303: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
304: 0 common_quantity_manual,
305: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
306: from ozf_sales_transactions_all a,
307: ozf_time_day b
308: where a.transaction_date = b.report_date
309: and a.error_flag = 'N'
310: and source_code = 'OM'
311: group by
324: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
325: 0 common_quantity_manual,
326: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
327: from ozf_sales_transactions_all a,
328: ozf_time_day b
329: where a.transaction_date = b.report_date
330: and a.error_flag = 'N'
331: and source_code = 'OM'
332: group by
345: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
346: 0 common_quantity_manual,
347: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
348: from ozf_sales_transactions_all a,
349: ozf_time_day b
350: where a.transaction_date = b.report_date
351: and a.error_flag = 'N'
352: and source_code = 'OM'
353: group by
366: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
367: 0 common_quantity_manual,
368: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
369: from ozf_sales_transactions_all a,
370: ozf_time_day b
371: where a.transaction_date = b.report_date
372: and a.error_flag = 'N'
373: and source_code = 'OM'
374: group by
387: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
388: 0 common_quantity_manual,
389: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
390: from ozf_sales_transactions_all a,
391: ozf_time_day b
392: where a.transaction_date = b.report_date
393: and a.error_flag = 'N'
394: and source_code = 'OM'
395: group by
408: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
409: 0 common_quantity_manual,
410: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
411: from ozf_sales_transactions_all a,
412: ozf_time_day b
413: where a.transaction_date = b.report_date
414: and a.error_flag = 'N'
415: and source_code = 'IS'
416: group by
429: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
430: 0 common_quantity_manual,
431: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
432: from ozf_sales_transactions_all a,
433: ozf_time_day b
434: where a.transaction_date = b.report_date
435: and a.error_flag = 'N'
436: and source_code = 'IS'
437: group by
450: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
451: 0 common_quantity_manual,
452: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
453: from ozf_sales_transactions_all a,
454: ozf_time_day b
455: where a.transaction_date = b.report_date
456: and a.error_flag = 'N'
457: and source_code = 'IS'
458: group by
471: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
472: 0 common_quantity_manual,
473: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
474: from ozf_sales_transactions_all a,
475: ozf_time_day b
476: where a.transaction_date = b.report_date
477: and a.error_flag = 'N'
478: and source_code = 'IS'
479: group by
492: sum(decode(a.transfer_type, 'OUT', nvl(a.common_quantity,0), 0)) common_quantity_out,
493: 0 common_quantity_manual,
494: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
495: from ozf_sales_transactions_all a,
496: ozf_time_day b
497: where a.transaction_date = b.report_date
498: and a.error_flag = 'N'
499: and source_code = 'IS'
500: group by
513: 0 common_quantity_out,
514: sum(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.common_quantity, 0)) common_quantity_manual,
515: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
516: from ozf_sales_transactions_all a,
517: ozf_time_day b
518: where a.transaction_date = b.report_date
519: and a.error_flag = 'N'
520: and source_code = 'MA'
521: group by
534: 0 common_quantity_out,
535: sum(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.common_quantity, 0)) common_quantity_manual,
536: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
537: from ozf_sales_transactions_all a,
538: ozf_time_day b
539: where a.transaction_date = b.report_date
540: and a.error_flag = 'N'
541: and source_code = 'MA'
542: group by
555: 0 common_quantity_out,
556: sum(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.common_quantity, 0)) common_quantity_manual,
557: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
558: from ozf_sales_transactions_all a,
559: ozf_time_day b
560: where a.transaction_date = b.report_date
561: and a.error_flag = 'N'
562: and source_code = 'MA'
563: group by
576: 0 common_quantity_out,
577: sum(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.common_quantity, 0)) common_quantity_manual,
578: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
579: from ozf_sales_transactions_all a,
580: ozf_time_day b
581: where a.transaction_date = b.report_date
582: and a.error_flag = 'N'
583: and source_code = 'MA'
584: group by
597: 0 common_quantity_out,
598: sum(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.common_quantity, 0)) common_quantity_manual,
599: SUM(decode(a.transfer_type, 'IN', 1, 'OUT', -1, 0) * nvl(a.primary_quantity,0)) primary_quantity
600: from ozf_sales_transactions_all a,
601: ozf_time_day b
602: where a.transaction_date = b.report_date
603: and a.error_flag = 'N'
604: and source_code = 'MA'
605: group by
658: SUM(CASE WHEN COM_BASELINE_QTY > 0 THEN COM_BASELINE_QTY ELSE 0 END) BASELINE_QTY,
659: SUM(CASE WHEN COM_BASELINE_AMT > 0 THEN COM_BASELINE_AMT ELSE 0 END) BASELINE_AMT
660: FROM
661: OZF_BASELINE_SALES_FACTS x,
662: OZF_TIME_DAY b
663: WHERE x.status_flag IS NULL
664: AND x.TRANSACTION_DATE = b.report_date
665: GROUP BY
666: x.DATA_SOURCE ,