I have created a report in v8.5 which runs on a grouped month. I have to use parameters for Jan - Dec that allows me to input the number of hours worked in each month.
If I use a simple date range parameter linked with my table {table.DOFF} I can run the report as long as I only select full months, and I also input the hours worked into the relevant months parameters.
However, what I would like to do is replace the date parameter with a parameter to select the relevant financial year (running April to March, defined as 2000/01, 2001/02 etc...) and have the report select the dates where I have added hours worked into the month’s parameter. I have created a formula which I have added to the Select Expert but it does not return any data.
if {?January} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,1)+mid({@financial year},9)) + ",01,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,1)+mid({@financial year},9)) + ",01,31"
] else
if {?February} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,1)+mid({@financial year},9)) + ",02,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,1)+mid({@financial year},9)) + ",02,28"
] else
if {?March} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,1)+mid({@financial year},9)) + ",03,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,1)+mid({@financial year},9)) + ",03,31"
] else
if {?April} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",04,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",04,30"
] else
if {?May} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",05,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",05,31"
] else
if {?June} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",06,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",06,30"
] else
if {?July} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",07,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",07,31"
] else
if {?August} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",08,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",08,31"
] else
if {?September} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",09,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",09,30"
] else
if {?October} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",10,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",10,31"
] else
if {?November} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",11,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",11,30"
] else
if {?December} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",12,01"
to date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",12,31"
]
I have had to use left and mid to create the year as, although the default selections in the financial year are as above it appears to add in commas and spaces.
I hope this makes sense and if not at least it might give some of you a laugh at how I tried to achieve the solution.
Lewis
United Kingdom
If I use a simple date range parameter linked with my table {table.DOFF} I can run the report as long as I only select full months, and I also input the hours worked into the relevant months parameters.
However, what I would like to do is replace the date parameter with a parameter to select the relevant financial year (running April to March, defined as 2000/01, 2001/02 etc...) and have the report select the dates where I have added hours worked into the month’s parameter. I have created a formula which I have added to the Select Expert but it does not return any data.
if {?January} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,1)+mid({@financial year},9)) + ",01,01"
if {?February} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,1)+mid({@financial year},9)) + ",02,01"
if {?March} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,1)+mid({@financial year},9)) + ",03,01"
if {?April} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",04,01"
if {?May} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",05,01"
if {?June} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",06,01"
if {?July} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",07,01"
if {?August} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",08,01"
if {?September} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",09,01"
if {?October} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",10,01"
if {?November} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",11,01"
if {?December} <> 0 then date({CPCASE.DOFF}) in [date(totext(left({@financial year},1)+mid({@financial year},3,3)) + ",12,01"
I have had to use left and mid to create the year as, although the default selections in the financial year are as above it appears to add in commas and spaces.
I hope this makes sense and if not at least it might give some of you a laugh at how I tried to achieve the solution.
Lewis
United Kingdom