Working on a record selection formula for creating a report with multiple charts, sorted by which "goal" they pertain to.
A few of these charts need to display a certain date range stored in the database, the rest need to display a rolling year. The date range is essentially a financial year for these ones, but are not all the same.
I have the rolling year working, but cannot get the records that need the date range specified to work.
Information about the table/data/formulas:
table1 = information about each goal (name, definitions of groups it belongs to, date range for financial year if necessary)
table2 = data for each goal
report_month = date for which data is being reported
data_through_date = date for which data was collected
?Report Month? = user selection of month the report is being written for
@rollingyear = container for the rolling year specification
Currently I'm trying out nested if statements (at the bottom of the code), but that doesn't seem to work.
Any help on this would be really appreciated!
A few of these charts need to display a certain date range stored in the database, the rest need to display a rolling year. The date range is essentially a financial year for these ones, but are not all the same.
I have the rolling year working, but cannot get the records that need the date range specified to work.
Information about the table/data/formulas:
table1 = information about each goal (name, definitions of groups it belongs to, date range for financial year if necessary)
table2 = data for each goal
report_month = date for which data is being reported
data_through_date = date for which data was collected
?Report Month? = user selection of month the report is being written for
@rollingyear = container for the rolling year specification
Code:
DateDiff("m",{table2.report_month},{?Report Month?}) < 12
Currently I'm trying out nested if statements (at the bottom of the code), but that doesn't seem to work.
Any help on this would be really appreciated!
Code:
//enabling past month report generation
{table2.report_month} <= {?Report Month?} and
//removes any records that are marked as changes
{table2.is_change} = false and
//removes outdated goals
if {table1.Active} = true and
//chooses report sorting and criteria
if {?Report Name} = "A" then
{table1.a} = true
else
if {?Report Name} = "B" then
{table1.overall_order} <>0
else
if {?Report Name} = "C" then
{table1.c}= true
else
if {?Report Name} = "D" then
{table1.d} = true
else
if {?Report Name} = "E" then
{table1.e} = true
else
if {?Report Name} = "F" then
{table1.f} = true
else
if {?Report Name} = "G" then
{table1.g} = true
else
//select p1 and p2 records from start to end if month is within p1 or p2, otherwise print all within rolling year
if {table1.p2} = true then
(if {table2.data_through_date} in {table1.p2_start} to {table1.p2_end} then
{table2.data_through_date} >= {table1.p2_start}
else {@rollingyear})
else
if {table1.p1} = true then
(if {table2.data_through_date} in {table1.p1_start} to {table1.p1_end} then
{table2.data_through_date} >= {table1.p1_start}
else {@rollingyear})
else
{@rollingyear}