FrankTWall
Technical User
I have searched this forum and cannot get my head around the correct way to solve this problem
CRW V8.5, Oracle DB
I have a report with 3 groups
G1 - Case status
G2 - case type
G3 - case ID
I have a formula that identifies which events in a case I want to count in the details section and I have then summed it in Group 3. Formula is very simple
if (isnull({CSRCSEV.CSRCSEV_DAYS}) or {CSRCSEV.CSRCSEV_DAYS} =1 )then 1
For example,
G1 - Finalised
G2 - Criminal Sum
G3 - case# 1111 2 (2 events for that case meet the criteria etc)
case# 2222 2
case# 3333 3
case# 4444 4
case# 4477 5
G2 - Civil
G3 - Case# 5555 4
Case# 6666 7
G1 - Pending
G2 - Criminal
G3 - Case# 321 5
Case# 4456 6
What I am trying to get is a median of the summarised field for each group
As per lbass's suggestion on other threads re this issue I have done a Top/N sort by the summary field and then placed a variable formula in Group 3 header
whileprintingrecords;
numbervar medianx;
if groupnumber = round(DistinctCount ({CWRCASE.CWRCASE_CASE_ID}, {CWRCASE.CWRCASE_CTYP_CODE})/2,0)
then
medianx := Sum ({@Event flag - all}, {CWRCASE.CWRCASE_CASE_ID}) else medianx := medianx;
I then have a display formula:
whileprintingrecords;
numbervar medianx;
in the Group report footer.
I am getting the correct return from the variable formula in Group 3 - for the first group (I know I have not allowed for even/uneven number of groups) BUT I cannot reset it to calculate for different groups
I have also replicated it to try and select only a certain type of case but this has failed
e.g.
whileprintingrecords;
numbervar medianx;
if
{CWRCASE.CWRCASE_CASE_ID} startswith "AP" and
groupnumber = round(DistinctCount ({CWRCASE.CWRCASE_CASE_ID}, {CWRCASE.CWRCASE_CTYP_CODE})/2,0)
then
medianx := Sum ({@Event flag - all}, {CWRCASE.CWRCASE_CASE_ID}) else medianx := medianx;
Anyone with any ideas?
Frank
CRW V8.5, Oracle DB
I have a report with 3 groups
G1 - Case status
G2 - case type
G3 - case ID
I have a formula that identifies which events in a case I want to count in the details section and I have then summed it in Group 3. Formula is very simple
if (isnull({CSRCSEV.CSRCSEV_DAYS}) or {CSRCSEV.CSRCSEV_DAYS} =1 )then 1
For example,
G1 - Finalised
G2 - Criminal Sum
G3 - case# 1111 2 (2 events for that case meet the criteria etc)
case# 2222 2
case# 3333 3
case# 4444 4
case# 4477 5
G2 - Civil
G3 - Case# 5555 4
Case# 6666 7
G1 - Pending
G2 - Criminal
G3 - Case# 321 5
Case# 4456 6
What I am trying to get is a median of the summarised field for each group
As per lbass's suggestion on other threads re this issue I have done a Top/N sort by the summary field and then placed a variable formula in Group 3 header
whileprintingrecords;
numbervar medianx;
if groupnumber = round(DistinctCount ({CWRCASE.CWRCASE_CASE_ID}, {CWRCASE.CWRCASE_CTYP_CODE})/2,0)
then
medianx := Sum ({@Event flag - all}, {CWRCASE.CWRCASE_CASE_ID}) else medianx := medianx;
I then have a display formula:
whileprintingrecords;
numbervar medianx;
in the Group report footer.
I am getting the correct return from the variable formula in Group 3 - for the first group (I know I have not allowed for even/uneven number of groups) BUT I cannot reset it to calculate for different groups
I have also replicated it to try and select only a certain type of case but this has failed
e.g.
whileprintingrecords;
numbervar medianx;
if
{CWRCASE.CWRCASE_CASE_ID} startswith "AP" and
groupnumber = round(DistinctCount ({CWRCASE.CWRCASE_CASE_ID}, {CWRCASE.CWRCASE_CTYP_CODE})/2,0)
then
medianx := Sum ({@Event flag - all}, {CWRCASE.CWRCASE_CASE_ID}) else medianx := medianx;
Anyone with any ideas?
Frank