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

need help with formula

Status
Not open for further replies.

unknownly

Programmer
Jul 7, 2003
181
US
Hi,
I have trouble show the data the way I have display. Can any one advice me on how to do this...is greatly apperciated

I have tbl where I will use 2 field's
1) attribute id
2) att_val_id
now there are different attribute id's and for each attribute id there a lot of att_val_id's.

ex: cat --is a attribute id and

white cat, black cat, brown cat, green cat ...so on are att_val_id and these are assigned to the units.

I have to separate the arrtibute Id selection and display the att_val_id's as 6 different Columns.
For this Iam using formulas @1,@2,@3...@6

in @1:

if attribute_id = 'cat' then
att_val_id
else
'N/A'

in @2"

if attribute_id = 'dog' then
att_val_id
else
'N/A'

I am displaying these 6 formulas as columns in the report. But I get six rows for the same unit.
How can I display all the values in one row for each unit?

This is how I get

unit name @1 @2 @3 ...... @6
100 aaa whitecat n/a n/a n/a
100 aaa n/a blackdog n/a n/a
100 aaa n/a n/a mat n/a
...
...
100 aaa n/a n/a n/a whatever


I need to display as

unit name @1 @2 @3 ...... @6

100 aaa whitecat blackdog mat whatever


I hope you guys understand what Iam trying to tell.


Thanks,
Sweetie
 
First group on {table.unit}. Then if you change your detail level formulas to:

if attribute_id = "cat" then
att_val_id
else
""

...you can insert a maximum on the formula at the group level, and if there is a "cat" in the column it will appear at the group level, although there will be a blank instead of "NA" otherwise. So create a second formula:

if maximum({@1}, {table.unit}) = "" then "NA" else ""

Insert a second Group #1 footer section (b) and position this formula under the maximum summary. Then go to format->section->group #1a footer and check "Underlay following sections". This will bring the "NA" for groups without "Cat" into alignment.

You'd have to repeat this for each column. Then suppress the details section.

-LB
 
First, I would like to Thank you.

This is what I tried before I read your posting.

I have changed all( 6 formulas) as eg( taking off the else part)
@1:
---
if attribute_id = "cat" then
att_val_id

@2:
---
if attribute_id = "dog" then
att_val_id

and I have grouped by Unit and in Group1:unit(footer) I have included 6 sections and place each formula accross in each section and in format section I have checked the underlay following sections. But I don't get any data for any of the 5 column and just get for 1 column.

Your advice looks like what Iam doing... Can you please explain me little more in order to get what I need. I don't understand where the data is missing for all there other 5 columns

Thanks,
Sweetie

 
Please reread my earlier post. Your formulas are correct for the DETAIL section, not the group section. Then right click on each one and choose insert summary->maximum and then you will see the result in the group footer--except when the result is null. That's why you need the other formula for the group footer_b section--so you can get the "NA" for the null summary.

-LB
 
Thank you! Lbass. It works. Iam sorry that I missed reading the those "" in ur post. I read ur post regularly I love the way u think.U r awesome!

Thanks,
Sweetie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top