Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Masi_Sahargahi
Contributor III
Contributor III

problem with subtotal

Hi guys,I'm new to Qlikview and i would be very appreciated if you help me out of this:

I have a pivot table that have some dimensions,I want to enable subtotal in my pivot table,Everything was fine until I added an expression that uses set analysis to filter data(between dates that user enters using input boxes).In this case subtotal disappears and I don't know how to fix it.

the expression is like that :

=if((OrderDate>=StartDate and OrderDate<=EndDate)or ([BillDate>=StartDate and [BillDate]<=EndDate),num(Sum({<oTypeNo={110}>}F_sraQuantitySecondUnit)),0)

Thanks a lot

6 Replies
Gysbert_Wassenaar

The condition of your if statement cannot be calculated at the subtotal level. OrderDate >=StartDate... which orderdate and which startdate should be used at the subtotal level? Qlikview doesn't know which of the possible values you want it to use.


talk is cheap, supply exceeds demand
Masi_Sahargahi
Contributor III
Contributor III
Author

thanks for reply

I want to have subtotal of the records that meet this condition(OrderDate >=StartDate) , How can I get that?

ant other solution?

Gysbert_Wassenaar

If you can use a straight table instead of a pivot table the solution is very simply: set the Total mode of the expression to Sum of rows. If you must use a pivot table you will have to use the aggr function to add an extra level of aggregation for the sums of the subtotals. Something like sum(aggr( ...if( ..etc...) , DimA,DimB,DimC) where DimA, DimB and DimC are the dimensions of your pivot table.


talk is cheap, supply exceeds demand
Masi_Sahargahi
Contributor III
Contributor III
Author

sorry for asking such a basic question, but with using straight table what would I loose(rather than using pivot table)?

thanks again

Gysbert_Wassenaar

You lose the ability to pivot a dimension to columns, the option to collaps/expand dimensions, the option to show subtotals at the dimension levels.


talk is cheap, supply exceeds demand
Masi_Sahargahi
Contributor III
Contributor III
Author

Actually I solved it with deleting the condition and using set analysis instead.

thanks a lot