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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to do grouping on exiting formula?

Status
Not open for further replies.

gegeying

Programmer
Feb 22, 2007
14
US
how to grouping on exiting formula

Here is my question:
On the report, there are currently 2 groups:
Group #1 Name: @activity_no
Group #2 Name: @district_no


For example:
001
D1
D2
D3
002
D1
D2
D3
003
D1
D2
D3
004
D1
D2
D3
005
D1
D2
D3
006
D1
D2
D3


Now, I want to insert a new group(called "activity_name") in front of Group #1 like following:

New Group #3(activity_name)
Group #1 Name: @activity_no
Group #2 Name: @district_no

For example, if @activity_no is 001, 003,004, then they shoud go to "sales"; If 002, 005, then go "management"; if 006, then "admin", etc.

The final report should looks like below;

SALES
001
D1
D2
D3
003
D1
D2
D3
004
D1
D2
D3
MANAGEMENT
002
D1
D2
D3
005
D1
D2
D3
007
D1
D2
D3
ADMIN
006
D1
D2
D3

So, my question is how to create a formula(?) grouping on existing formula(i.e grouping @activity_no)?

Thanks alot
 
It looks like you want to know how to add a group and make it group #1 after you already have 2 groups. If that is the case, add the group then click on the group in the left margin (you should see a little hand) and move it to the top of the previous groups.
 
How would we know what's in @activity_no? So,how could we possibly make sure that we have a proper solution?

Anyway, you can try creating the formula and grouping on it:

if {@activity_no} in ["001", "003","004"] then
"sales"
else
If {@activity_no} in ["002", "005"] then "management"
else
if {@activity_no} = "006" then "admin"
else
...etc...

-k
 
Well, maybe my question is not clear.

I am trying to create a group(group 1) on existing formula(called f1), which is for group 2.

It should looks like following:
Group 1
Group2
Group3


To create this Group 1, I create a following formula as f2:

If f1 in ['001','003','004'] ThEN 'Sales'
ELSE
If f1 in ['002','005'] THEN 'MANAGEMENT'
ELSE
If f1 = '006' THEN 'ADMIN'
ELSE
'OTHER'


You see this Group 1 is based the value of Group 2's value.
How can I use f2's value make Group 1?


Eventually, the result should show like this:

SALES
001
Group 3
003
Group 3
004
Group 3
MANAGEMENT
002
Group 3
005
Group 3
ADMIN
006
Group 3
OTHER
 
Again, we don't know what's in @activity_no.

Why would you keep asking the same question instead ofposting what's in there? It isn't obvious that we don't know?

-k

 
All you have to do is insert a group on {@f2} and then either go to design mode and drag it into the Group #1 position or go to report->group expert and use the arrow keys to put it in the #1 position.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top