Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Problem combining AGGR and Set analyses. Always want to compare to same thing

HI,

I'm having problems with building a formula. This picture shows it best.

case.png

The CALC1 field should Always be the total of the productgroup: baseset.

I've succeeded with doing that with for the first part with the formula
SUM(TOTAL <[PRODUCTGROUP]> AMOUNT)

Unfortunately I can't get it to work when the table hits the productgroup "Sales".

See the picture.

SUM(TOTAL <[PRODUCTGROUP]> {<PRODUCTGROUP={'BASESET'}>}AMOUNT) doesn't do the trick.

I've included a .qvw file with script and GUI. Can anyone help? Thanks!

1 Solution

Accepted Solutions

Re: Problem combining AGGR and Set analyses. Always want to compare to same thing

Use a helper variable. For example vTotal_BASESET: =sum({<PRODUCTGROUP={'BASESET'}>}AMOUNT)

See attached qvw.


talk is cheap, supply exceeds demand
4 Replies

Re: Problem combining AGGR and Set analyses. Always want to compare to same thing

Hi,

Use CALC1 formula as

$(=SUM( {<PRODUCTGROUP={'BASESET'}>} AMOUNT) )

Re: Problem combining AGGR and Set analyses. Always want to compare to same thing

Use a helper variable. For example vTotal_BASESET: =sum({<PRODUCTGROUP={'BASESET'}>}AMOUNT)

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable

Re: Problem combining AGGR and Set analyses. Always want to compare to same thing

Thanks! That solves it!

I'm absolutely surprised to see that the formula does not work when coded into the expression, but that it does work when using a variable.

Thanks!

case2.png

Not applicable

Re: Problem combining AGGR and Set analyses. Always want to compare to same thing

oh wow. It seems I got 2 correct answers!

Thanks for this one too.

Community Browser