Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

1 Solution

Accepted Solutions
rubenmarin

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

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.