BusinessObjects Board

Foreach formula advice

Hi Dave,

I am having a lot of trouble getting a simple query to change to what i want it to – I believe i am inputting the formula correctly as i have not have problems before using something like this:.

query 1 (Product / Store / Stock)
Query 2 (Store) Distinct list of store’s set by myself in a different universe.

Merge: query1.store = query2.store
Source dimension: Query2.store

Currently query 1 will give me a total stock figure by store / product level.
I require the store’s from query 2 to be the one i sum up against so i’ve tried:

=Sum([stock].[Total Branch Stock Unit] ForEach ([Query 2].[STORE]))

This still gives me the stock figure from query 1 (it should be lower as i have tested this on another tab to see what the output is).

I’ve tried many variations of the above formula but all seem to get me the sum of product from query 1 when infact i need it to sum against query 2 store.

Please advise, help would be much appreciated.

AR


kushty88 (BOB member since 2014-08-13)

Just to confirm, you have four objects:
Q1.Product, Q1.Store, Q1.Stock
Q2.Store

If that’s correct and you’ve merged on Q1.Store to Q2.Store then in your block, use Q2.Store, not the merged Store dimension if you just want the Q2 stores.