# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for
Did you mean:
Highlighted
Creator II

## In which year which fruit has crossed more than \$1000 sales

Hi All,

I need some help. From the below sample data. I would like to identify only the records of the fruits that crossed the \$1000 sales for the first time.

Example: Grapes has crossed \$1000 first time in 2015. I just want to show that one record I do not want to see all the years of the fruits which crossed greater than \$1000.

 Fruits Year sales Apples 2015 \$500 Apples 2016 \$700 Apples 2017 \$1,100 Grapes 2015 \$1,200 Grapes 2016 \$600 Grapes 2017 \$1,100 Mangoes 2015 \$1,000 Mangoes 2016 \$1,300 Mangoes 2017 \$1,200

Thanks,

-Vidya

Labels (1)
• ### products that crossed \$1000 for the first time

3 Solutions

Accepted Solutions
Highlighted
MVP

Check this out

Dimension

`Fruits`

Expressions

```Min({<sales = {'>=1000'}>}Year)
FirstSortedValue({<sales = {'>=1000'}>} sales, Year)```
Highlighted
MVP

Try this script

```Table:
Fruits, Year, sales
Apples, 2015, 500
Apples, 2016, 700
Apples, 2017, 1100
Grapes, 2015, 1200
Grapes, 2016, 600
Grapes, 2017, 1100
Mangoes, 2015, 1000
Mangoes, 2016, 1300
Mangoes, 2017, 1200
];

Right Join (Table)
Min(Year) as Year
Resident Table
Where sales >= 1000
Group By Fruits;```
Highlighted
Creator II
Thanks for all your help today.
8 Replies
Highlighted
MVP

So, you want to see 1 row per each fruit? 2015 for Grapes, 2017 for Apples, and 2015 for Mangoes?

Highlighted
Creator II

Thats correct.

Highlighted
MVP

Check this out

Dimension

`Fruits`

Expressions

```Min({<sales = {'>=1000'}>}Year)
FirstSortedValue({<sales = {'>=1000'}>} sales, Year)```
Highlighted
Creator II

Awesome this is exactly what I am looking for. By any chance can we achieve the same in the load script editor?

Highlighted
MVP

So, you mean that bring in only 3 rows and drop all other rows?

Highlighted
Creator II
Yes, That's correct.
Highlighted
MVP

Try this script

```Table:
Fruits, Year, sales
Apples, 2015, 500
Apples, 2016, 700
Apples, 2017, 1100
Grapes, 2015, 1200
Grapes, 2016, 600
Grapes, 2017, 1100
Mangoes, 2015, 1000
Mangoes, 2016, 1300
Mangoes, 2017, 1200
];

Right Join (Table)