Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

Is anyone ready to help me on my question ?

Jason_Michaelides
Partner - Master II
Partner - Master II

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

jagan
Partner - Champion III
Partner - Champion III

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
Author

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
Author

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

Thanks.

jagan
Partner - Champion III
Partner - Champion III

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.