78: l_url := 'pFunctionName=POA_DBI_APL_STATUS_RPT&VIEW_BY_NAME=VIEW_BY_ID&VIEW_BY=HRI_PERSON+HRI_PER&pParamIds=Y';
79: end if;
80:
81: l_query := get_status_sel_clause(l_view_by, l_view_by_col, l_url, l_sec_context) ||
82: ' from '|| fnd_global.newline ||
83: poa_dbi_template_pkg.status_sql(
84: p_fact_name => l_mv,
85: p_where_clause => l_where_clause,
86: p_join_tables => l_join_tbl,
168: l_mv_tbl(2).mv_where := l_where_clause2;
169: l_mv_tbl(2).in_join_tbls := l_in_join_tbl2;
170: l_mv_tbl(2).use_grp_id := 'N';
171: l_query := get_status_sel_clause(l_view_by, l_view_by_col, l_url, l_sec_context) ||
172: ' from ( '||fnd_global.newline ||
173: poa_dbi_template_pkg.union_all_status_sql(
174: p_mv => l_mv_tbl,
175: p_join_tables => l_join_tbl,
176: p_use_windowing => 'Y',
179: p_generate_viewby => 'Y',
180: p_diff_measures => 'N');
181: else
182: l_query := get_status_sel_clause(l_view_by, l_view_by_col, l_url, l_sec_context) ||
183: ' from '|| fnd_global.newline ||
184: poa_dbi_template_pkg.status_sql(
185: p_fact_name => l_mv,
186: p_where_clause => l_where_clause,
187: p_join_tables => l_join_tbl,
253: poa_dbi_util_pkg.add_column(l_col_tbl, 'leakage_amount_' || l_cur_suffix, 'leakage_amount', 'N');
254:
255: poa_dbi_util_pkg.add_column(l_col_tbl, 'amount_' || l_cur_suffix, 'amount', 'N');
256:
257: l_query := get_trend_sel_clause || ' from '|| fnd_global.newline ||
258: poa_dbi_template_pkg.trend_sql(
259: p_xtd => l_xtd,
260: p_comparison_type => l_comparison_type,
261: p_fact_name => l_mv,
339: l_mv_tbl(2).in_join_tbls := l_in_join_tbl2;
340: l_mv_tbl(2).use_grp_id := 'N';
341: l_mv_tbl(2).mv_xtd := l_xtd;
342:
343: l_query := get_trend_sel_clause('union') || ' from ' ||fnd_global.newline ||
344: poa_dbi_template_pkg.union_all_trend_sql(
345: p_mv => l_mv_tbl,
346: p_comparison_type => l_comparison_type,
347: p_diff_measures => 'N');
345: p_mv => l_mv_tbl,
346: p_comparison_type => l_comparison_type,
347: p_diff_measures => 'N');
348: else
349: l_query := get_trend_sel_clause || ' from ' || fnd_global.newline ||
350: poa_dbi_template_pkg.trend_sql(
351: p_xtd => l_xtd,
352: p_comparison_type => l_comparison_type,
353: p_fact_name => l_mv,
558: l_sel_clause varchar2(4000);
559:
560: BEGIN
561: if (p_type = 'trend') then
562: l_sel_clause := 'select cal.name VIEWBY,'||fnd_global.newline;
563: else
564: l_sel_clause := 'select cal_name VIEWBY,'||fnd_global.newline;
565: end if;
566: l_sel_clause := l_sel_clause || 'nvl(p_leakage_amount,0) POA_MEASURE1,
560: BEGIN
561: if (p_type = 'trend') then
562: l_sel_clause := 'select cal.name VIEWBY,'||fnd_global.newline;
563: else
564: l_sel_clause := 'select cal_name VIEWBY,'||fnd_global.newline;
565: end if;
566: l_sel_clause := l_sel_clause || 'nvl(p_leakage_amount,0) POA_MEASURE1,
567: nvl(c_leakage_amount,0) POA_MEASURE2,
568: nvl(p_leakage_amount,0) POA_PERCENT1,