Solved

SQL OR CRYSTAL HELP

Posted on 2014-12-23
6
196 Views
Last Modified: 2014-12-24
I'm trying to create a report that has a table that lists part numbers and a table that lists an attribute name and a third table that lists the attribute value.  There are up to 7 different attribute names but each part number usually has between zero and four attributes.  When I create a CR that shows the part number and the attribute name and value, a part that has four different attributes will show up four different times, one for each attribute.  I want to somehow display all attributes 1's in one column, 2's in a second column and so forth, with the part number listed only once.  The attributes have a UID (1-7) but they also have a name. Ultimately, I would like to create a new view for this as I seem to always need this info.  I'm not too familiar with SQL so don't really know how to do that.  How can I get this info all on one line in a report?
0
Comment
Question by:ITworks
6 Comments
 
LVL 17

Expert Comment

by:OriNetworks
ID: 40515236
While I do not fully understand what you are trying to accomplish it would help the community if you share the sql you have created so far and maybe a screenshot of the report layout you have created.

My first thought was that you may benefit from a subreport to show the attributes for each part but then you mentioned to have all of the attributes on one line which I do not understand.
0
 
LVL 18

Expert Comment

by:vasto
ID: 40515288
You need to use left join between the parts, attribute name and attribute value. This will create a view with all parts, attributes name and corresponding values (if any). Then use a Cross tab to place the parts and rows, attribute names as columns and attributes values as values
0
 
LVL 4

Author Comment

by:ITworks
ID: 40515391
Untitled.png
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 4

Author Comment

by:ITworks
ID: 40515394
0
 
LVL 34

Accepted Solution

by:
James0628 earned 500 total points
ID: 40516306
I can think of a few ways to do something like that in CR.  How many UID's can there be for a "part"?  Is there a set limit of 7, or could there be more?  If there could be more, and you're not sure how many, then you may need a more sophisticated solution (like a cross-tab, like vasto suggested).

 If there is a set limit, you could try something like this.

 Using your sample report, with 4 formulas for UID's 1 - 4.  Group the report on whatever identifies a "part" (lot and item_id?), and suppress the detail section.  Put lot, item_id and item_desc in the group header or footer (your choice).  Right-click on each of your formulas in the detail section (eg. @COO) and select Insert > Summary, and create a Maximum summary for the "part" group (not a grand total).  Put those summary fields in your group header or footer with the other fields.

 I think that should work.

 James
0
 
LVL 4

Author Closing Comment

by:ITworks
ID: 40516733
That did it!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now