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

How to top 20 negative values in table box over two years side by side

Hi Qlik, learners,

 

User want to see top 20 negative Account values for the years of 2022 and 2021 side by side, condition is show me if the 

account is negative values in both the years, otherwise dont show  , i.e show only if the account having negative values in 

both the years and he want top 20 negative values,how we can achive this please anyone can suggest me 

1 Reply
justISO
Specialist
Specialist

Hi, let's try something like this. You load your data. I just use dummy sample with fields 'Acc', 'Year' and  'Value'

In report level we add 'Acc' field and take only top20 (bottom) value based on y2021. (If you need top20 of y2022, change places y2021 and y2022 columns)

justISO_0-1670855275903.png(21 is because it counts row with null values, so to get top20 we need to 20+1)

For separate years we add 2 measures. One for y2021:

=if(sum({<Year={'2021','2022'}>} Value)<0, sum({<Year={'2021'}>} Value))

And one for y2022:

=if(sum({<Year={'2021','2022'}>} Value)<0, sum({<Year={'2022'}>} Value))

On Add-ons uncheck include zero values to show only Acc with both negative values:

justISO_2-1670855459274.png