Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Summing the Header versus the detail

In my application I have a balance table for the month and transactions that are generated that apply to the month.  What I want to do is sum the balances over time but not have it inflated by the transactions for that month.  I believe this falls into the classic case of header / detail, because the detail has been purged, I no longer can just some the detail.  I'm a newbie so I'm not sure how to enter the expression.

Thanks

13 Replies
Not applicable
Author

Are you using Plant as a dimension? If you are not and a product is in more than one plant you will get the weight twice.

You could try this and see how it works.

sum(aggr(sum(end_balance * weight),plant_name, close_period))

If this does not help can you post a copy of your actual script?

Not applicable
Author

Yes, that is where I made my mistake, when I setup the data structure I

removed the key fields from the header and left them in the detail. Once

I swapped which table the fields were coming from everything came back

into order.

Thanks for your help.

From:

marcsliving <qliktech@sgaur.hosted.jivesoftware.com>

To:

scottsimmons <scottsimmons@bp.guardian.com>

Date:

04/17/2012 11:18 AM

Subject:

- Re: Summing the Header versus the detail

QlikCommunity

Re: Summing the Header versus the detail

created by marcsliving in New to QlikView - View the full discussion

It sounds like you are joining the tables. If you use a keep instead of

join and your expression comes from the header table you should get the

correct results.

Reply to this message by replying to this email -or- go to the message on

QlikCommunity

Start a new discussion in New to QlikView by email or at QlikCommunity

© 1993-2011 QlikTech International AB Copyright & Trademarks | Privacy

| Terms of Use | Software EULA

Not applicable
Author

I made my mistake, when I setup the data structure I removed the key

fields from the header and left them in the detail. Once I swapped which

table the fields were coming from everything came back into order.

Thanks for your help.

From:

Juan Fibonacci <qliktech@sgaur.hosted.jivesoftware.com>

To:

scottsimmons <scottsimmons@bp.guardian.com>

Date:

04/17/2012 11:11 AM

Subject:

- Re: Summing the Header versus the detail

QlikCommunity

Re: Summing the Header versus the detail

created by Juan Fibonacci in New to QlikView - View the full discussion

is one of the name of your fields in your transaction table cost or

balance?

Reply to this message by replying to this email -or- go to the message on

QlikCommunity

Start a new discussion in New to QlikView by email or at QlikCommunity

© 1993-2011 QlikTech International AB Copyright & Trademarks | Privacy

| Terms of Use | Software EULA

Not applicable
Author

I made my mistake, when I setup the data structure I removed the key

fields from the header and left them in the detail. Once I swapped which

table the fields were coming from everything came back into order.

Thanks for your help.

From:

Jonathan Dienst <qliktech@sgaur.hosted.jivesoftware.com>

To:

scottsimmons <scottsimmons@bp.guardian.com>

Date:

04/17/2012 11:07 AM

Subject:

- Re: Summing the Header versus the detail

QlikCommunity

Re: Summing the Header versus the detail

created by Jonathan Dienst in New to QlikView - View the full discussion

Hi

I am still not clear on the details of your data structure so its hard to

make specific suggestions. Could you post an example file?

Regards

Jonathan

Reply to this message by replying to this email -or- go to the message on

QlikCommunity

Start a new discussion in New to QlikView by email or at QlikCommunity

© 1993-2011 QlikTech International AB Copyright & Trademarks | Privacy

| Terms of Use | Software EULA