Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ajaysingh29
Contributor III
Contributor III

Need help with Aggregating data

Hi All,

I have attached test QVW, need help to get result in 2 pivot tables.

Below expression are not working:

1) Aggr(sum(Amt)*(Pdate-Ddate),DocumentType,[Doc Des],[Late - On Time],Year,month)

2) Aggr(sum(Amt)*(Pdate-Ddate),DocumentType,[Doc Des],[Late - On Time],Year,month)/sum(amt)

test2.PNG

Thank you!

3 Replies
jmvilaplanap
Specialist
Specialist

Hi

I tried to see what values has Pdate - Ddate, but almost always is null:

Capture.PNG

I think you have to fix this first.

Regards

jmvilaplanap
Specialist
Specialist

Ahh, and you can't use Aggr function as "final aggregation", if you need the sum, with this sum(Amt)*(Pdate-Ddate) is enough.

Kushal_Chawda

You have multiple instances of your Dates for each dimension of your Pivot. So you need to consider either Min or Max date for all possible combination like below

sum(Amt)* (max(Pdate)-max(Ddate))