Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
poojask123
Partner - Creator
Partner - Creator

Adding Set Analysis to Sum(aggr())

Hi,

I have the below expression to calculate a weightage.

=NUM(SUM(((aggr(avg(num([Check Date])-num([Invoice Date])),[KEY_CompanyInvoiceNumberVendorNum]))*[Invoice $]))/

(Sum(IF(aggr(([Check Amount]),[Check Number])>0, aggr(([Check Amount]),[Check Number]),Aggr(sum([Gross Amount]),[Check Number])))),'#,##0')

This expression should be modified to add a set analysis like below, into the above expression:

{<Check_Date = {'>= $(vYearStart) <= $(vYearEnd)'}>}

Please help.

Thanks

Pooja

1 Reply
Anonymous
Not applicable

Within the first sum:

=NUM(SUM({<Check_Date = {'>= $(vYearStart) <= $(vYearEnd)'}>} ((aggr(avg(num([Check Date])-num([Invoice Date])),[KEY_CompanyInvoiceNumberVendorNum]))*[Invoice $]))/

(Sum(IF(aggr(([Check Amount]),[Check Number])>0, aggr(([Check Amount]),[Check Number]),Aggr(sum([Gross Amount]),[Check Number])))),'#,##0')