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: 
linoyel
Specialist
Specialist

Aggr and Set analysis

Hey,

I have the following expression in the table:

Sum (if(cctranzresponse=000,Sum,0)) / Sum(aggr(Max(First_Try_Amount),unique_num,Department,UpType,IsOnline))

Now I need to write the same expression but for the certain bookmark and country.

I tried this:

Sum ({AppRate * 1<BillingCountryKey = {191}>} if(cctranzresponse=000,Sum,0)) /

Sum({AppRate * 1<BillingCountryKey = {191}>} aggr(Max(First_Try_Amount),unique_num,Department,UpType,IsOnline))

This works only when BillingCountry 191 is selected, but I want the expression not to be dependent on user selections...

1 Solution

Accepted Solutions
linoyel
Specialist
Specialist
Author

Well, I figured it out

This worked:

Sum({AppRate * 1<BillingCountryKey = {191}>} if(cctranzresponse=000,Sum,0)) /

Sum({AppRate * 1<BillingCountryKey = {191}>}aggr(Max({AppRate * 1<BillingCountryKey = {191}>} (First_Try_Amount)),unique_num,Department,UpType,IsOnline))

View solution in original post

10 Replies
MK_QSL
MVP
MVP

Sum ({1<BillingCountryKey = {191}>} if(cctranzresponse=000,Sum,0)) *AppRate /

Sum({1<BillingCountryKey = {191}>} aggr(Max(First_Try_Amount),unique_num,Department,UpType,IsOnline))*AppRate

Or

Sum ({1<BillingCountryKey = {191}>} if(cctranzresponse=000,Sum*AppRate ,0)) /

Sum({1<BillingCountryKey = {191}>} AppRate*aggr(Max(First_Try_Amount),unique_num,Department,UpType,IsOnline))

linoyel
Specialist
Specialist
Author

Hi Manish, in both of your answers AppRate isn't recognized, probably it's location is the expression in incorrect...

MK_QSL
MVP
MVP

Can you upload your sample file or sample data?

linoyel
Specialist
Specialist
Author

I don't know how to upload file...

linoyel
Specialist
Specialist
Author

Well, I figured it out

This worked:

Sum({AppRate * 1<BillingCountryKey = {191}>} if(cctranzresponse=000,Sum,0)) /

Sum({AppRate * 1<BillingCountryKey = {191}>}aggr(Max({AppRate * 1<BillingCountryKey = {191}>} (First_Try_Amount)),unique_num,Department,UpType,IsOnline))

MK_QSL
MVP
MVP

untitled.bmpUse advanced editor... and add your file as an attachment...

Advance Editor option is available at the TOP RIGHT...

linoyel
Specialist
Specialist
Author

Use advanced editor where? What is advanced editor?

MK_QSL
MVP
MVP

If you try to reply, you will find the screen where usually we write... search there.

linoyel
Specialist
Specialist
Author

Oh, I see! Thank you!

So uploading file is called "binary upload"? Or "binary upload" is something else?