Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

probelm with splitting and grouping

Status
Not open for further replies.

swiss2007

Technical User
Aug 13, 2007
92
US
I have 2 different sets of questions for which the codes are dynamically assigned in the report as

shown below.

For Ex:
//This formula is used in Report Header

whilereadingrecords;
numbervar array a;
numbervar i;
numbervar j := 60;
stringvar array y1 := ["1.A","1.A,2.C","2.G","3.A,2.C","8.c" and so on upto 60 Questions,

stringvar array y2 := ["2.C,3.B","1.A,2.G","2.G","3.B","2.A" and so on upto 60 Questions

for i := 1 to j do(
redim preserve a[j];
a := i;
);

//This formula is used in Details
whilereadingrecords;
numbervar array a;
stringvar array y1;
stringvar array y2;
numbervar i;
numbervar j;
stringvar z;

for i := 1 to j do(
if {Office.Questionnumber} = a and
{office.TYPE} = "Local" then
z := y1 else
if {Office.Questionnumber} = a and
{office.TYPE} = "non-local" then
z := y2
);
z

These Questions are answered as correct,incorrect or None based on different different question

numbers and offices i.e local and non-local.
So,I want to group on the codes namele 1.A,2.A,2.C,2.G,3,G and so on.
If I group on Details section I get 1.A,1.A,2.c but not 1.A and 2.C.
It means if a question is given the code 1.A,2.C and answered correct then I want to count this

question in 1.A and 2.C.
In other words,I want to split and group on Questions and count it twice if answered correct.
Hope its clear.Is there a way to do this.
Thanks.
 
Can you explain the logic of assigning two codes to one record in the first place if you later want to group based on one code? The problem is that one record can only be assigned to one group, so that you will not be able to split the code and have the same record appear in two groups. You would have to do something like use a union statement to add another set of records for these secondary criteria.

I've explained in an earlier post to you how you can count the codes with your current setup, so I'm guessing the current issue is more one of display.

-LB
 
Hi lbass,
I understand what you are saying.Sorry,it should have been stringvar array y1 := ["1.A","1.A,2.C","2.G","3.A,2.C","8.c" and so on upto 60 Questions,stringvar array y2 := [" "," "," "," "," ","2.C,3.B","1.A,2.G","2.G","3.B","2.A" and so on upto 60 Questions.

In other words means that, there are 60 questions which have codes either in stringvar array y1 or stringvar array y2.
I want a report layout like the one shown below

Office(either local or non-local)
---------------------------------

1.A No of Questions with incorrect answers
--------------------------------
(No of Questions with correct answers
+ No of Questions with incorrect answers)
- No of Questions with none answers



2.A No of Questions with incorrect answers
--------------------------------
(No of Questions with correct answers
+ No of Questions with incorrect answers)
- No of Questions with none answers

and so on and like this there are many codes.
I am using running totals in the report footer.

Actually the codes are provided by the customers and they have multiple codes for Questions.I was using running totals before which was fine but application is not supporting this report because of too many report footer sections.
So I thought of grouping on the codes after splitting if there is a possibilty which could avoid me using many sections

You are absolutely right lbass,this is a display issue.
is there any other way to resolve this issue.
Thanks for the information.







 
Hi lbass,
I could solve the problem,I tried to merge some of the sections and the report works fine within the application.Thanks lbass for your invaluable help.
 
hi lbass,
referring to this previous issue,the people have requested a new report that could be possible but requires many formulas.As stated before how could it be possible to use a union and then split and group.
For ex;
Group 1.A
---
1
2
3
Group 2.A
---
4
5
6
Group 1.A,2.A
-------------
7
8
9

How to split the group 1.A,2.A to group 1.A and group 2.A and include the records 7,8,9 to Group 1.A and Group 2.A.
I dont need the group 1.A,2.A anymore.

Thanks for your valuable time,help
Thanks



 
I don't know how you got the combined group in the first place. If a record will only be counted in one place, then you don't need to use a union for this.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top