Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Akshaya
Contributor III
Contributor III

Need Top 10 from the table based on Category

Hi All,

I am working on a Qliksense sheet, where I am including a table, and In that table i need only Top 10 records based on a criteria, as per below:(here LEGAL ENTITY is OU only)

Akshaya_0-1673528444814.png

The columns are as below:

Akshaya_1-1673528724084.png

And for calculating TOTAL, i am using below Expression:

Akshaya_2-1673528827729.png


if(Sum({< Common_Year={">=$(=Year(Max(today())))<=$(=Max(today()))"},
Common_Month=,
REC_TYPE={InvoiceDateRec}>} (RAGLDA_ACCTD_AMOUNT*XRATE_CONST*RATE))>1E6, num(Sum({< Common_Year={">=$(=Year(Max(today())))<=$(=Max(today()))"},
Common_Month=,
REC_TYPE={InvoiceDateRec}>} (RAGLDA_ACCTD_AMOUNT*XRATE_CONST*RATE))/1E6,'#,##0.00M')
,if(Sum({< Common_Year={">=$(=Year(Max(today())))<=$(=Max(today()))"},
Common_Month=,
REC_TYPE={InvoiceDateRec}>} (RAGLDA_ACCTD_AMOUNT*XRATE_CONST*RATE))>1E3, num(Sum({< Common_Year={">=$(=Year(Max(today())))<=$(=Max(today()))"},
Common_Month=,
REC_TYPE={InvoiceDateRec}>} (RAGLDA_ACCTD_AMOUNT*XRATE_CONST*RATE))/1E3,'#,##0.00K')
,num(Sum({< Common_Year={">=$(=Year(Max(today())))<=$(=Max(today()))"},
Common_Month=,
REC_TYPE={InvoiceDateRec}>} (RAGLDA_ACCTD_AMOUNT*XRATE_CONST*RATE)),'#,##0.00')
))

And with above expression if am trying to use Rank, Aggregate or something like that, its giving me error as this formula already has too many Sum() functions being used.

P.S. I already tried the Fixed Number Formatting and setting it as 10, but no luck.

 

Please Advise how can I proceed with this?

Thankyou so much!

@GeorgePhilips23 @MayilVahanan @marcus_sommer @durgesh22 @Bill_Britt @rwunderlich 
Qlik Sense Business 

 

Labels (5)
1 Reply
MayilVahanan

HI

Try something like below

Store the above expression in the variable without "=" sign, otherwise, it evaluate the expression, and 

rank(aggr(UrVariable, OU))

Based on the requirement, either you can restrict via the expression or via calculated dimension.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.