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!

Crystal Count/summary workaround needed

Status
Not open for further replies.

sch9009

IS-IT--Management
Feb 15, 2011
6
US
So I know that with crystal you can summarize on said summaries.. but I have read about work arounds, but trying to apply to my situation.

First let me explain the basis of my report:

This report shows items that are in a supply room. With a lot of formula, it suggests what "Par Level" an item should have... par meaning, what is the average order during the week. This report recommends if the par level should be raised or lowered.

We put the formula together by finding the daily average (for how often the item is ordered) and factored that against the frequency the item is ordered during the week.

Where I am getting into trouble is creating a report based on the one explained where I can see how many items at Location A need the par raised, lowered, and left alone... and show the same for location B... eventually, the end users will just drill down on their respected locations.

When I try to group and count the items (based on if the item's par should be raised or lowered) I run into cannot be summarized errors.

I attached a file with some screen shots to help visualize this.

This file shows storage location WC6C, with a handful of items and their recommended par modification. The daily average was calculated by adding up all orders for a specified date range, and divided it by order frequency (which is 6 days a week). The recommendations to raise or lower a par are compared to the current par level (all of which you will see in the attachment)...

So in the long run, we will be able to run this report and see how many items on various locations have items that need to raise or lower their par levels.

In english: looking to count all the raise par, lower par, and not change needed and tie them to each location:

example:

Location Raise Par Lower Par No Change
WC6C 25 Items 4 Items 15 Items
WC7C 5 Items 2 Items 20 Items


and so on and so forth.

Eventually, we will want to be able to drill down into each respective category, but that can be saved for another time.

I have a feeling this will have to be solved with shared values... which I am terrible at.

thanks

 
Your link won't work since it is referencing your own c drive.

Instead of describing your calculations, you should be showing the actual content of your formulas. Please show the content of the formula you are trying to group on and the field/formula you are trying to summarize.

-LB
 
Formula that I am trying to group by or summarize (i.e. count if..)

@par analysis= IF {ITEMLOC.REORDER_POINT}<{@3 Day Average} then "UP PAR" else
IF {ITEMLOC.REORDER_POINT}>{@5 Day Max} then "REDUCE PAR" else "SUFFICIENT PAR LEVEL"

For the formulas that make "@Par analysis" work
@3 Day Average=ROUNDUP({@Daily Average}*3,0)
@5 Day Max=ROUNDUP({@Daily Average}*5,0)

These two formulas above denote the minimum par level that should be recommended, and the maximum par level that should be recommended.

Daily average is calculated by:

@daily Average=
IF {?Number Of Times Par Location Counted Per Week}= "1" then{@Convert To Par UOM}/({@Number of Days}*(1/7)) else
IF {?Number Of Times Par Location Counted Per Week}= "2" then{@Convert To Par UOM}/({@Number of Days}*(2/7)) else
IF {?Number Of Times Par Location Counted Per Week}= "3" then{@Convert To Par UOM}/({@Number of Days}*(3/7)) else
IF {?Number Of Times Par Location Counted Per Week}= "5" then{@Convert To Par UOM}/({@Number of Days}*(5/7)) else
IF {?Number Of Times Par Location Counted Per Week}= "6" then{@Convert To Par UOM}/({@Number of Days}*(6/7)) else
IF {?Number Of Times Par Location Counted Per Week}= "7" then{@Convert To Par UOM}/({@Number of Days}*(7/7))

@Convery To Par UOM=Total amount ordered of the item. We converted all orders to base UOM.

 
The need to drill down is important and not actually for another time. You are showing the equivalent of a crosstab.

You still have not shown the content of all of your formulas, but I'm guessing you could probably create the above format by using running totals that do the count of whatever you are counting, with an evaluation formula like this:

{ITEMLOC.REORDER_POINT}<{@3 Day Average} //for UP Par

Reset on change of group: location. Place the running total in the location group footer and suppress other report sections. However, you couldn't drill down on the group footer just for a specific category, e.g., UP Par. You might instead be able to add on-demand subreports for each of the three categories that uses a text version of the running total as the hyperlink though.

-LB
 
@3 Day Average = ROUNDUP({@Daily Average}*3,0)
@ 5 Day Max = ROUNDUP({@Daily Average}*5,0)

@ Convert to Par UOM = IF {ITEMMAST.ALT_UOM_01}={ITEMLOC.UOM} THEN (Sum ({@Lowest UOM Quantity}, {ITEMLOC.ITEM}) / {ITEMMAST.ALT_UOM_CONV_01}) ELSE
IF {ITEMMAST.ALT_UOM_02}={ITEMLOC.UOM} THEN (Sum ({@Lowest UOM Quantity}, {ITEMLOC.ITEM}) / {ITEMMAST.ALT_UOM_CONV_02}) ELSE
IF {ITEMMAST.ALT_UOM_03}={ITEMLOC.UOM} THEN (Sum ({@Lowest UOM Quantity}, {ITEMLOC.ITEM}) / {ITEMMAST.ALT_UOM_CONV_03}) ELSE
IF {ITEMMAST.ALT_UOM_04}={ITEMLOC.UOM} THEN (Sum ({@Lowest UOM Quantity}, {ITEMLOC.ITEM}) / {ITEMMAST.ALT_UOM_CONV_04}) ELSE
IF {ITEMMAST.ALT_UOM_05}={ITEMLOC.UOM} THEN (Sum ({@Lowest UOM Quantity}, {ITEMLOC.ITEM}) / {ITEMMAST.ALT_UOM_CONV_05}) ELSE
IF {ITEMMAST.ALT_UOM_06}={ITEMLOC.UOM} THEN (Sum ({@Lowest UOM Quantity}, {ITEMLOC.ITEM}) / {ITEMMAST.ALT_UOM_CONV_06})

(@Daily Average) = IF {?Number Of Times Par Location Counted Per Week}= "1" then{@Convert To Par UOM}/({@Number of Days}*(1/7)) else IF {?Number Of Times Par Location Counted Per Week}= "2" then{@Convert To Par UOM}/({@Number of Days}*(2/7)) else
IF {?Number Of Times Par Location Counted Per Week}= "3" then{@Convert To Par UOM}/({@Number of Days}*(3/7)) else
IF {?Number Of Times Par Location Counted Per Week}= "5" then{@Convert To Par UOM}/({@Number of Days}*(5/7)) else
IF {?Number Of Times Par Location Counted Per Week}= "6" then{@Convert To Par UOM}/({@Number of Days}*(6/7)) else
IF {?Number Of Times Par Location Counted Per Week}= "7" then{@Convert To Par UOM}/({@Number of Days}*(7/7))


@Date=IF {REQLINE.CREATION_DATE} in {?Start Date} to {?End Date} then "Date"

@ITEM GROUP= IF {ITEMMAST.ITEM_GROUP}="NYPH" THEN "NYPH"

@ITYPETOTAL (inventory item purchase total) = IF isnull({POLINE.QUANTITY}) then ({REQLINE.QUANTITY}-{REQLINE.KILL_QUANTITY})*{REQLINE.ENT_UOM_MULT}


@NTYPETOTAL (non-inventory item purchase total) = IF{POLINE.QUANTITY}>0 then ({POLINE.QUANTITY}-{POLINE.CXL_QTY})*{POLINE.EBUY_UOM_MULT}

@Lowest UOM Quantity = IF {@Date}="Date" then
IF isnull({POLINE.QUANTITY}) then ({@ITYPETOTAL}) ELSE
IF {POLINE.QUANTITY}=0 then ({@ITYPETOTAL}) ELSE
IF {POLINE.QUANTITY}>0 THEN ({@NTYPETOTAL}) ELSE ({@ITYPETOTAL})

@Par Analysis = IF {ITEMLOC.REORDER_POINT}<{@3 Day Average} then "UP PAR" else
IF {ITEMLOC.REORDER_POINT}>{@5 Day Max} then "REDUCE PAR" else "SUFFICIENT PAR"

@Start Date=IF {REQLINE.CREATION_DATE} in {?Start Date} to {?End Date} then "Date Range"

ITEMLOC.LOCATION = WC6C. Eventually we want to see all locations.

I tried the running total suggestion but the formula wouldn't show up in the running total field selector.


 
I have a personal aversion for infinitely nested formulas as you are showing here, and that nesting is in part why the running totals don't work for you.

You can handle counts like this using variables and you would need one variable per par category. If you group on location, you can then use formulas like this:

//{@reset for your location group header}:
whileprintingrecords;
numbervar raise;
numbervar lower;
numbervar nochg;
if not inrepeatedgroupheader then (
raise := 0;
lower := 0;
nochg := 0
);

//{@accum} for your item group section:
whileprintingrecords;
numbervar raise;
numbervar lower;
numbervar nochg;
IF {ITEMLOC.REORDER_POINT} < {@3 Day Average} then
raise := raise + 1 else
IF {ITEMLOC.REORDER_POINT} > {@5 Day Max} then
lower := lower + 1 else
nochg := nochg + 1;

//{@displraise} for the location group footer:
whileprintingrecords;
numbervar raise;

//{@displlower} for the location group footer:
whileprintingrecords;
numbervar lower;

//{@displnochg} for the location group footer:
whileprintingrecords;
numbervar nochg;

-LB
 
thanks man. I will try this now.

What do you recommend I do besides nested formulas? I have been working with crystal for about 2 and a half years.

I'm sort of a scrappy worker, so if I get it to work, I do it.

But I am all about being more efficient.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top