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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
qolkaram
Contributor III
Contributor III

Sum Up Top N

HI every one ,

I have below sample data:

REPORT_DATE

month

Site_ID

outage

6/1/2016

2016-06

1

120

6/2/2016

2016-06

1

500

6/1/2016

2016-06

2

300

7/1/2016

2016-07

4

120

7/2/2016

2016-07

3

500

7/2/2016

2016-07

3

300

I want to sum up Top N Site Outage per month (first i should calculate site outage per month then sum up top N site outage per month) .  I have to do it in front end (in expression) not in script.

I appreciate if someone help me.

Labels (1)
15 Replies
jyothish8807
Master II
Master II

Hi Nassim,

What do you mean by Top N over here ? N could be any value ?

BR,

KC

Best Regards,
KC
tresB
Champion III
Champion III

Try like:

=Sum(Aggr(If(Rank(Sum(outage))<=vTop, Sum(outage)), Site_ID))

Capture.PNG

qolkaram
Contributor III
Contributor III
Author

Topn.jpgthanks Tresesco  , but  need Top N per Month , actually finally i need a chart like below

tresB
Champion III
Champion III

PFA

qolkaram
Contributor III
Contributor III
Author

Sorry Tressco i couldn't reply on your last post ,

by the way , i don't want to add site_id in Dimension ,( As you can see in the chart there is two bar for each month total monthly outage and top25Site outage ) so now how can i first calculate monthly sum of outage per side_id and then  sum up Outage of  top N site_id .

qolkaram
Contributor III
Contributor III
Author

some actual data attached

tresB
Champion III
Champion III

Not really sure about your requirement.

qolkaram
Contributor III
Contributor III
Author

during last week i tried to find a solution but still i am confused .

tresB
Champion III
Champion III

Now since you are here, please try more on clarifying your requirement better.