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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot table issue

Hi, 

I am new to qlikview. Can you please help me to solve my issue. I am attaching .qvw file for your reference. In Table 1 values are showing correctly. In Table 2 (Though it is same except I have  replaced 'product' with 'revenue Repertoire' field in dimension. 

Your help highly appreciated. 

Regards,

Suhas

Labels (1)
1 Solution

Accepted Solutions
rubenmarin
MVP
MVP

Hi Sushas, when showing by revenue the expression won't work because there are more than one value for fields like Relase Date.

If you want a sum of the products in each 'revenue Repertoire' one option can be tell qv to calculate the sum of each produt and YYYYMM using aggr(), in example:

Frontline: =sum(aggr(if (ReleaseDate <= MakeDate(Left(YYYYMM,4),Right(YYYYMM,2)) AND ReleaseDate >= AddMonths(MakeDate(Left(YYYYMM,4),Right(YYYYMM,2)),-11), sum({<[Source]={'SME'},[Prod Type Desc]={'RBT'},[Revenue Repertoire]=>}Quantity))/100, [Revenue Repertoire], Product, YYYYMM))

Catalouge: =Sum(aggr(if (ReleaseDate <= AddMonths(MakeDate(Left(YYYYMM,4),Right(YYYYMM,2)),-12), sum({<[Source]={'SME'},[Prod Type Desc]={'RBT'}>}Quantity))/100, [Revenue Repertoire], Product, YYYYMM))

Hope this helps.

View solution in original post

2 Replies
rubenmarin
MVP
MVP

Hi Sushas, when showing by revenue the expression won't work because there are more than one value for fields like Relase Date.

If you want a sum of the products in each 'revenue Repertoire' one option can be tell qv to calculate the sum of each produt and YYYYMM using aggr(), in example:

Frontline: =sum(aggr(if (ReleaseDate <= MakeDate(Left(YYYYMM,4),Right(YYYYMM,2)) AND ReleaseDate >= AddMonths(MakeDate(Left(YYYYMM,4),Right(YYYYMM,2)),-11), sum({<[Source]={'SME'},[Prod Type Desc]={'RBT'},[Revenue Repertoire]=>}Quantity))/100, [Revenue Repertoire], Product, YYYYMM))

Catalouge: =Sum(aggr(if (ReleaseDate <= AddMonths(MakeDate(Left(YYYYMM,4),Right(YYYYMM,2)),-12), sum({<[Source]={'SME'},[Prod Type Desc]={'RBT'}>}Quantity))/100, [Revenue Repertoire], Product, YYYYMM))

Hope this helps.

Not applicable
Author

Thanks Ruben for your prompt response.