Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Usage of Aggregation

Hi,

I have below mention expression and I want to convert to aggregation expression, reason behind converting into aggregration expression because I have multiple dimention and in each dimention I want total but with below mention expression it is limted to only VOUCHERNO.

I have below mention dimention on my piovt chart :

BRANCH_CODE,

YEAR,

QUARTER,

MONTH,

ITEMTYPE,

VOCHERDATE ,

VOCHERNO,

STOCKCATEGORY,

STOCKCODE

-------------------------------------------------------------------------

(

(sum(DISCOUNTCC))

*

(

(sum(SALESPRICE))

/

(sum(TOTAL<VOCHERNO>SALESPRICE))

*100

)

/100

)

--------------------------------------------------------------------------

I had tried to below mention expression but i did not get any result but not sure why

-------------------------------------------------------------------------

aggr(

(sum(DISCOUNTCC))

*

(

(sum(SALESPRICE))

/

(sum(TOTAL<VOCHERNO>SALESPRICE))

*100

)

/100

,BRANCH_CODE,YEAR,QUARTER,MONTH,ITEMTYPE,VOCHERDATE,VOCHERNO,STOCKCATEGORY,STOCKCODE

)

--------------------------------------------------------------------------

So any idea why ?

6 Replies
Not applicable

Re: Usage of Aggregation

Is anyone ready to help me on my question ?

jason_michaelid
Not applicable

Re: Usage of Aggregation

Can you provide a sample? And clearly describe the output you require.

jagan
Not applicable

Re: Usage of Aggregation

Hi,

Try this expression

Sum(

aggr(

(sum(DISCOUNTCC))

*

(

(sum(SALESPRICE))

/

(sum(TOTAL<VOCHERNO>SALESPRICE))

*100

)

/100

,BRANCH_CODE,YEAR,QUARTER,MONTH,ITEMTYPE,VOCHERDATE,VOCHERNO,STOCKCATEGORY,STOCKCODE

))

Hope this helps you.

Regards,

Jagan.

Not applicable

Re: Usage of Aggregation

Thanks Jagan mohan,

it is all most same answer I am looking for.

After trying above mention expression I had found that when I am exploring and reaching to individual item calculation is correct but when I am closing one by one dimension total is getting reduce.

I will prepare example from real data and post here so you guys and understand the issue.

Appreciate your time and cooperation.

Not applicable

Re: Usage of Aggregation

I had post reply on jagan post and sure I will prepare sameple data from real data and post here.

Thanks.

jagan
Not applicable

Re: Usage of Aggregation

Hi,

Try this expression

Sum( TOTAL <BRANCH_CODE,YEAR,QUARTER,MONTH,ITEMTYPE,VOCHERDATE,VOCHERNO,STOCKCATEGORY,STOCKCODE>

(sum(DISCOUNTCC))

*

(

(sum(SALESPRICE))

/

(sum(TOTAL<VOCHERNO>SALESPRICE))

*100

)

/100)

Hope this helps you.

Regards,

Jagan.