I am opening a new thread to explain everything clearly with example.
there is 1 date parameter, there is always 2 years of data.
I have 2 groups Country and Region.
I have the following structure.
PH Current Prior %Change YTDCurrent YTDPrior %ChangeYearly
Monthly
GH1a
GH1b Country
GH2 (Region)
GF2 Brussels $0.00 $4,333.30 -100.00% $6,839.40 $5,952.85 14.89%
BC $14,783.45 $14,967.29 -1.23% $15,223.58 $40,263.49 -62.19%
Greater London $659.70 $3,843.80 -82.84% $8,116.60 $11,017.32 -26.33%
and so on
Formulas:
currentmonth: if year({Orders.Order Date}) = 2005
and month({Orders.Order Date}) = month({?orderdate})
then {Orders.Order Amount} else 0
currentmonthsum: sum({@Currentmonth},{Customer.Region})
priormonth: if year({Orders.Order Date}) = 2004
and month({Orders.Order Date}) = month({?orderdate})
then {Orders.Order Amount} else 0
priormonthsum: sum({@Priormonth},{Customer.Region})
ytdcurrent: if year({Orders.Order Date}) = year({?OrderDate})
and
month({?OrderDate}) <= month({Orders.Order Date})
then {Orders.Order Amount}
ytdcurrentmonthsum: sum({@YTDCurrent},{Customer.Region})
ytdprior: if year({Orders.Order Date}) = year({?OrderDate})-1
and
month({Orders.Order Date}) <= month({?OrderDate})
then {Orders.Order Amount}
ytdpriorsum: sum({@YTDPrior},{Customer.Region})
trying to suppress regions which doesnt meet the following criteria
sum({@YTDPrior},{Customer.Region}) = 0
or
(sum({@YTDCurrent},{Customer.Region})-sum({@YTDPrior},{Customer.Region}) %
sum({@YTDPrior},{Customer.Region})) < 5 in the section expert
and suppress countries which doesnt have atleast 1 region.
using
in the sub, use a shared variable like this in the region group section (header or footer):
whileprintingrecords;
shared numbervar cnt;
if sum({@presentyr},{table.region})-sum({@previousyr},{table.region}) % sum({@previousyr},{table.region}) < 5 then
cnt := cnt else
cnt := cnt + 1;
In the country group header (still in the sub), use a reset formula like this:
whileprintingrecords;
shared numbervar cnt;
if not inrepeatedgroupheader then
cnt := 0;
In the country group footer, use:
whileprintingrecords;
shared numbervar cnt;
In the main report, go into the section expert->GH1_b (where your usual country group header fields are)->suppress->x+2 and enter:
whileprintingrecords;
shared numbervar cnt;
cnt = 0 //note no colon
So the thing finally I am trying to do is to suppress the pageheaders if the whole report doesnt meet any criteria
where sum({@presentyr},{table.region})-sum({@previousyr},{table.region}) % sum({@previousyr},{table.region}) < 5
Hope this is clear enough
there is 1 date parameter, there is always 2 years of data.
I have 2 groups Country and Region.
I have the following structure.
PH Current Prior %Change YTDCurrent YTDPrior %ChangeYearly
Monthly
GH1a
GH1b Country
GH2 (Region)
GF2 Brussels $0.00 $4,333.30 -100.00% $6,839.40 $5,952.85 14.89%
BC $14,783.45 $14,967.29 -1.23% $15,223.58 $40,263.49 -62.19%
Greater London $659.70 $3,843.80 -82.84% $8,116.60 $11,017.32 -26.33%
and so on
Formulas:
currentmonth: if year({Orders.Order Date}) = 2005
and month({Orders.Order Date}) = month({?orderdate})
then {Orders.Order Amount} else 0
currentmonthsum: sum({@Currentmonth},{Customer.Region})
priormonth: if year({Orders.Order Date}) = 2004
and month({Orders.Order Date}) = month({?orderdate})
then {Orders.Order Amount} else 0
priormonthsum: sum({@Priormonth},{Customer.Region})
ytdcurrent: if year({Orders.Order Date}) = year({?OrderDate})
and
month({?OrderDate}) <= month({Orders.Order Date})
then {Orders.Order Amount}
ytdcurrentmonthsum: sum({@YTDCurrent},{Customer.Region})
ytdprior: if year({Orders.Order Date}) = year({?OrderDate})-1
and
month({Orders.Order Date}) <= month({?OrderDate})
then {Orders.Order Amount}
ytdpriorsum: sum({@YTDPrior},{Customer.Region})
trying to suppress regions which doesnt meet the following criteria
sum({@YTDPrior},{Customer.Region}) = 0
or
(sum({@YTDCurrent},{Customer.Region})-sum({@YTDPrior},{Customer.Region}) %
sum({@YTDPrior},{Customer.Region})) < 5 in the section expert
and suppress countries which doesnt have atleast 1 region.
using
in the sub, use a shared variable like this in the region group section (header or footer):
whileprintingrecords;
shared numbervar cnt;
if sum({@presentyr},{table.region})-sum({@previousyr},{table.region}) % sum({@previousyr},{table.region}) < 5 then
cnt := cnt else
cnt := cnt + 1;
In the country group header (still in the sub), use a reset formula like this:
whileprintingrecords;
shared numbervar cnt;
if not inrepeatedgroupheader then
cnt := 0;
In the country group footer, use:
whileprintingrecords;
shared numbervar cnt;
In the main report, go into the section expert->GH1_b (where your usual country group header fields are)->suppress->x+2 and enter:
whileprintingrecords;
shared numbervar cnt;
cnt = 0 //note no colon
So the thing finally I am trying to do is to suppress the pageheaders if the whole report doesnt meet any criteria
where sum({@presentyr},{table.region})-sum({@previousyr},{table.region}) % sum({@previousyr},{table.region}) < 5
Hope this is clear enough