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: 
ZimaBlue
Creator
Creator

AGGR does not work with the filter

Hello.

I have the following fields: user_id, feedback date, payment date, payment amount. There may be several feedbacks per user, so the payment amounts may be duplicated. I use AGGR to avoid summing duplicate rows and count only unique ones.

I use the following formula to calculate the amount of payments for each review 7 days before it:

SUM({1 <payment_date={"=payment_date>=week_before_n and payment_date<=date_tech_2"}>} AGGR(SUM({1 <payment_date={"=payment_date>=week_before_n and payment_date<=date_tech_2"}, user_id=P(user_id), payment_id=P(payment_id)>}
DISTINCT sum_payments),
payment_date, user_id, payment_id))

This formula works correctly, but the problem is that as soon as I filter a specific user_id, pivot table stops displaying anything at all and I only see "-" instead of the sum amount. How to make it work, including with any filter?

Labels (1)
1 Reply
vinieme12
Champion III
Champion III

Your expression is set to consider P(user_id)

 

=SUM({1 <payment_date={"=payment_date>=week_before_n and payment_date<=date_tech_2"}, user_id=P(user_id), payment_id=P(payment_id)>}
DISTINCT sum_payments)

 

Can you post some sample data?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.