Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3462

Urgently Need Help!! Sum Formula Not Working After Next Grouping Level!

$
0
0

Ok all please bear with me.  I'm relatively new to Webi and its autogrouping behavior, and I'm used to using odbc through Microsoft Access to query and derive whatever I want.  They are turning the odbc connection off though and we will now be forced to use Webi for everything, and it's up to me to convert everything over.

 

So I'm trying my first report, and wanted to do something relatively basic, but I don't know how to get the value I need or why it's behaving the way it is.  To give a quick assessment, we have Process orders that are broken up into different submixings, and each submixing has it's own materials in it, like a recipe, and are called pours.  Some of these submixings are done manually, while others are automated and the pours done on our robots. 

 

What I'm trying to do, is on a PO level, get the total number of pours remaining for all A type (automated) submixings within that PO.  I have a variable I created called pours remaining that has the sum formula, and it works fine when the data is still at the submixing level.  You'll see below (IDSM is the submixing id) that for example the first PO, 13533731, has 5 submixings.  The 2nd and 3rd on the list are automated, and you'll see the pours remaining variable is working fine, giving the pours remaining for only those 2 submixings while the other 3 show 0, as desired.  The last two columns are the original number of pours and the pours already completed, so it's simply the difference of those two.  See screenshot, followed afterwards by what is then going wrong:

 

image (2).png

 

So now is where the problem starts.  When I remove the IDSM column, thereby generating a PO level grouping, the formula totally breaks.  I was hoping on a PO level the pours remaining column would show 24 for PO 13533731, as I expected it to simply add the 13 and 11.  Instead, as you'll see below, it not only no longer sums only A type workstations, but it sums the pours remaining for ALL workstations, even the header ones that aren't included in the output.  That total is 34.  But that's not all.  It takes that 34, and multiplies it by the number of A type workstations, yielding in this case a value in the pours remaining field of 68, as there were two A type workstations.  So what am I doing wrong??  What do I need to do to just simply have that 13 and 11 sum only and give me 24?  This is super urgent and I need any insight asap, and I would be extremely grateful!  Please see second screenshot below for what it happening when I remove the IDSM column: 

image (3).png

 

Again, as you'll see, PO 13533731 now says 68 pours remaining instead of the 24 I want it to show, and it's ignoring the workstation type completely. It's simply totaling all pours regardless of type, and multiplying it by the number of A type workstations.  So 34 total pours (some pours you don't see because they're not ones that would be displayed, but the total would be 34), and then multiplied by 2 A type workstations yields 68.  That is NOT what I want.  You'll also see further down, PO 13539453 showing 60, which is the 20 total pours of all workstations regardless of type, multiplied by 3, because there were 3 automated workstations etc. I know part of it has to do with a merge, but not sure what to do about it.  There are two bex queries in the report, one that is pour level, one that is submixing level.  I have it merged on PO and IDSM (submixing id), and I think even Workstation type as well.  The joins should be appropriate.  But I'm sure that has something to do with why it's multiplying the sum.

 

This is the formula I use for the PoursRemaining Variable.  I've tried several iterations, trying different sums within the formula etc, but for sake of simplicity I'll paste the most basic.  It's : =Sum(If [Type Post] = "A" Then ([Number of Pours] - [Number of Pours Done]) Else 0)

 

What do I need to do, so that what is seen in the first screenshot, would carry over appropriately with IDSM removed and it becomes PO level based?  So that it just sums the 13 and 11 and shows the pours remaining for only A type workstations?

 

I know this is long, but I wanted to be thorough in hopes it would be understood what I'm trying to do and what is happening.  I need help asap, and I'm hoping someone sees this quickly!  Thanks so much in advance!!!

 

Jeremy


Viewing all articles
Browse latest Browse all 3462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>