How to modify the groupoptions of a date in a crosstab
How to modify the groupoptions of a date in a crosstab
(OP)
Hi! Does anyone know if its possible to change the group options of a date in a crosstab,manually by vb code?
This is because i want to show the columns in differents formats for example by week, biweek, monthly, annualy, etc. so i want to avoid to make a lots of rpt files, I want to use only one and only change the property.
I tried something like:
Dim rrep As CRAXDRT.CrossTabGroup
rrep.Condition = crGCAnnually
but it produces an error (obj or var not set).
Thanks
This is because i want to show the columns in differents formats for example by week, biweek, monthly, annualy, etc. so i want to avoid to make a lots of rpt files, I want to use only one and only change the property.
I tried something like:
Dim rrep As CRAXDRT.CrossTabGroup
rrep.Condition = crGCAnnually
but it produces an error (obj or var not set).
Thanks
RE: How to modify the groupoptions of a date in a crosstab
{?date group interval} with defaults: daily, weekly, biweekly, monthly, annually. Then create a formula {@dategroup}:
if {?date group intervals} = "daily" then
date({table.date}) else
if {?date group intervals} = "weekly" then
date(dateadd("ww",datepart("ww",{table.date})-1,date(year({table.date}),01,01)
-dayofweek(date(year({table.date}),01,01))+1)) else
if {?date group intervals} = "biweekly" then
(if remainder(datepart("ww",{table.date}),2) = 0 then
date(dateadd("ww",datepart("ww",{table.date})-2,date(year({table.date}),01,01)
-dayofweek(date(year({table.date}),01,01))+1)) else
date(dateadd("ww",datepart("ww",{table.date})-1,date(year({table.date}),01,01)
-dayofweek(date(year({table.date}),01,01))+1))) else
if {?date group intervals} = "monthly" then
date(year({table.date}),month({table.date}),01) else
if {?date group intervals} = "annually" then
date(year({table.date}),01,01)
Use this formula as your column field in the crosstab.
-LB
RE: How to modify the groupoptions of a date in a crosstab
Regards jebarcha.