Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot table, with calculated column

Hi,

This is an actualization of a previous post, Thanks to Gysbert Wassenaar to solve one of my problems.

I have this entry data

MonthDataTypeValue1Value2
01R101
01O121
02R111
02O152

and I would like to obtain this result

MonthTotal0201
DataTypeRO%RO%RO%
Value1212777,78%111573,33%101283,33%
Value22366,67%1250,00%11100,00%

where the rows Value1 and Value2 are expresions and the colum % is an aditional value of the dimension DataType

Value1 = sum(Value1)                    in % column sum({<DataType={'R'}>} Value1) / sum({<DataType={'O'}>} Value1)

Value2 = sum(Value2)                    in % column sum({<DataType={'R'}>} Value2) / sum({<DataType={'O'}>} Value2)

but the result obtained is this

MonthTotal0201
DataTypeRORORO
Value1212711151012
Value2231211

Any suggestions?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached example. No idea how this holds up under millions of records. You may have to resort to creating summary tables in the script.


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

Gysbert, Thanks for this solution. It's working fine, but the number of records generated is too high. We are working with millions of records (and Value1, Value2 are really Value1, Value2 .. Value60) and inplementing this solution, the application performance is greatly deteriorated. Is there any other way to get the desired result without greatly increasing the number of records?

Gysbert_Wassenaar

See attached example. No idea how this holds up under millions of records. You may have to resort to creating summary tables in the script.


talk is cheap, supply exceeds demand
Not applicable
Author

Gysbert, Thanks for this solution. It's working fine.