Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Naresh1
Contributor III
Contributor III

How to find out second lowest profit in the year query and total profits till previous year

How to find out second lowest profit in the year and total profits till previous year 

Anyone please tell me

1 Solution

Accepted Solutions
sugathirajkumar
Creator
Creator

use  this min({<Year={'$(=max(Year))'}>}Sales,2)   jus replaced max with min

View solution in original post

2 Replies
sugathirajkumar
Creator
Creator

max({<Year={'$(=max(Year))'}>}Sales,2)  for second largest sale 

sum({<Year-={'$(=max(Year))'}>}total Sales) - Total sale till last year

 

A:
load * inline [
Year ,Sales
2016,200
2016,700
2017,300
2017,200
2017,700
2017,800
2017,100
2017,560

2018,200
2018,500
2018,234
2018,456
2018,754
2018,897
];
exit script ;

sugathirajkumar
Creator
Creator

use  this min({<Year={'$(=max(Year))'}>}Sales,2)   jus replaced max with min