Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight table sum difference

All,

I have attached a sample qlikview work file.

I have pulled the data and used that in a straight table. The straight table contain the following items.

Dimension

Date, Center and Shift

Expression

Start - min(PGAuditDateTime)

End - max(PGAuditDateTime)

Length - (Interval(Max(PGAuditDateTime)-Min(PGAuditDateTime),'h:m'))  - i have used sum of rows in expression

Graded Qty= sum(GradedQty)

Graded / Hour = (sum(GradedQty)/(interval(time(End, 'hh:mm') - time(Start, 'hh:mm'), 'hh:mm')*24))

but the Graded / hour partial sum shows a different value...

in this example the hours is 372.04 thats correct (i have used sum of rows in expression in expression tab) and graded qty is 197539 thats also correct, but the Graded / Hour= 182.45 which is wrong, it should be of 531.

Anybody please have a look on that and let me know. its a bit of urgent

Appreciate your time and help

Thanks

Ranjith Kumaran

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try:

if(Dimensionality()=0,

sum(GradedQty)/sum(aggr(interval(max(PGAuditDateTime)-min(PGAuditDateTime)),ProcessCenter,PcShift,Date))/24,

sum(GradedQty)/interval(max(PGAuditDateTime) - min(PGAuditDateTime))/24

)


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

Try:

if(Dimensionality()=0,

sum(GradedQty)/sum(aggr(interval(max(PGAuditDateTime)-min(PGAuditDateTime)),ProcessCenter,PcShift,Date))/24,

sum(GradedQty)/interval(max(PGAuditDateTime) - min(PGAuditDateTime))/24

)


talk is cheap, supply exceeds demand
anbu1984
Master III
Master III

You are getting 182 because Total calculation based on your expression is like this

197539 / Max(Dt) - Min(Dt)

=197539 / 9/9/2014 2:58:27AM - 7/26/2014 12:15:33 AM

=197539 / 1082 : 42

=182.45

1082 : 42 -- You can see this value in your pivot table

Not applicable
Author

It works perfect!!! thanks