Link to home
Start Free TrialLog in
Avatar of JustinBMak
JustinBMak

asked on

SAP Crystal Reports - Formula to Display particular data in an existing report

SAP Crystal Reports.

I have a table with 5 columns in the table, which has a Left Outer Join to display the correct data, etc. However I need to doing something special on this report I am building for our Production floor.

The table is called 'UPC' however in the 'UPC' table the system/software keeps both the Carton Label and the UPC for a particular product. The issue is that even though they are both being kept in there, they are not in the same order.

Example would be for Product #123, UPC maybe the second inserted record in the DB and the Carton label would be the first but for Product #456, it would be visa-versa, etc. So who ever entered in the data, or it could be just the system itself, didn't put it in the same order (1. UPC 2.) Carton Label), etc. So on this Crystal Reports, I would like to build two (maybe two) 'formula' where it would it see that the # starts a '1' then it is a Carton Label and put it in the Carton Label area and if it starts with a '0', it would be a UPC, etc.


Of the top of my head, it would be 1 forumula but with both math formulas in there used twice? I'm not sure, but if someone could point me in the right direction, I would appreciate it.
Avatar of Ido Millet
Ido Millet
Flag of United States of America image

Add the UPC table twice to your report. Crystal would require, and allow, you to give  each instance a different name (alias).
Leave the 1st instance as UPC.
Give the 2nd instance an alias of Carton.
Join normally (I assume based on Product #).
Add a record selection formula that filters the UPC alias down to only UPC rows.
Similarly, filter the Carton alias down to only Carton cases.
This would ensure that each product joins to only 1 row in the UPC alias and only 1 row in the Carton alias.
You then simply pick the column from each alias to give you the UPC and the Carton.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.