Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Crystal 10 formula for stock quantities from two tables

Posted on 2013-12-07
Medium Priority
Last Modified: 2013-12-11
I have two tables invt.dat and strstk.dat

invt.dat stores information on inventory stock and strstk.dat stores information on which stores hold what stock quantities.

I want to create a report that lists stock and the holdings in each store.

invt.dat has one line in each table for each product line. It simply looks like this
With data looking like this
070701|Red Box|2.50
070702|Blue Box|2.50

strstk.dat looks like this

The data in strstk looks like this though
070702|01|0.00 ....

So when I link the two tables by SKU the report I print gives me three lines per product when I really want this...


070701|Red Box|2.50|1.00|0.00|3.00
070702|Blue Box|2.50|0.00|.....

Can someone help me create a formula or solution that can yield this report?

Question by:holdsworthbros
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 101

Accepted Solution

mlmcc earned 2000 total points
ID: 39704648
I can think of 3 ways to do this

You can do it with a cross tab, in the report through groups and summary formulas or you can do it through a Crystal command.

Insert a cross tab into the report header or footer
Right click the cross tab in the upper left corner
Row - product
Column - store
summary - store qty

Group method
Add a group on the stock item
Add 3 formulas
Name - Store1Qty

If {Store} = 1 then

Name - Store2Qty

If {Store} = 2 then

Name - Store3Qty

If {Store} = 3 then

Insert the 3 formulas into the detail section
Right click each in turn
Type SUM
Put it in the group footer
Click OK
Drag it to the group header

Repeat for each formula
suppress the detail section and the group footer

SQL method
Create a command as

SELECT Inv.SKU, Inv.Desc, ST1.Qty as St1Qty, ST2.Qty as ST2Qty, ST3.Qty as ST3Qty
FROM  ((invt Inv Left Outer Join strstk ST1 ON Inv.SKU = ST1.SKU and  ST1.Store = 1)
Left Outer Join strstk ST2 ON Inv.SKU = ST2.SKU and  ST2.Store = 2)
Left Outer Join strstk ST3 ON Inv.SKU = ST3.SKU and  ST3.Store = 3)


Author Comment

ID: 39707580

I like the 2nd method, but I want to learn about cross tabs so will try that too.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

618 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