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

Mulitple row expression calculations in Crosstab/Pivot table

Given the following dataset (assuming current month is September 2013);

UserIDTransactionTypeTransactionDateAmount
1Online01/01/136
1Online01/01/135
1Offline09/01/134
1Offline01/01/132
2Online01/01/131
2Online01/01/132
2Online01/01/134
3Online09/01/133
3Online09/01/134
3Online01/01/135
3Online01/01/136
3Offline01/01/133
3Offline01/01/138

I am trying to produce a table such like;

    

Transaction Type
OnlineOffline
UserIDMTDYTDMTDYTD
1SumAmount-5.546
MaxAmount-644
2SumAmount-7--
MaxAmount-4--
3SumAmount718-11
MaxAmount46-8

I have been successful in producing this table for the 'SumAmount' metric alone, but I have been unsuccessful in getting the 'SumAmount' and 'MaxAmount' in different rows of the same table.

So far I have been using a pivot table (thanks to advice on other threads) with UserID and Transaction Type as dimensions and sum of Amount in MTD period and sum of Amount in YTD period as expressions and dragging and dropping the rows to columns.

Does anybody have any clues as to how to get the Sum Amount and Max Amount as different rows in the same table?

I have provided an example dataset here, the actual dataset has upwards of 30million rows so a solution outside of altering the load process would be more preferable.

TIA.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can try a synthetic dimension, but I don't think you want this with 30 million records. Performance is likely to be dramatic, if you don't get an allocated memory exceeded error first that is. The alternative is to use four expressions and display them all four as rows or all four as columns.


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can try a synthetic dimension, but I don't think you want this with 30 million records. Performance is likely to be dramatic, if you don't get an allocated memory exceeded error first that is. The alternative is to use four expressions and display them all four as rows or all four as columns.


talk is cheap, supply exceeds demand