# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld starts MONDAY! last chance to register is now ! REGISTER NOW
cancel
Showing results for
Did you mean:
Contributor III

## Find the first day of Sales for the current year

Hello Everyone!
I'm trying to calculate the first day of work of the current year for a filtered sales rep. To do so, I need to find the date of his/her first sale of the year.

Using the following formula the system returns me a wrong date.
ES: min(date(\$(=year(today()))), sales_ID)

Forcing the year to "2020" it returns me the same result as above.
ES: min(date(\$(=year('2020'))), sales_ID)

Where did I go wrong?

Thanks in advance for any help!

Labels (5)

• ### Set Expression

1 Solution

Accepted Solutions
Contributor III
Author

Solved using:

FirstSortedValue ({1<year = {\$(=year(today()))}>} distinct date, date)

6 Replies
MVP

You can try this

``Min({<Year = {"\$(=Year(Today()))"}>} Date)``
Creator III

try once using firstsortedvalue

Contributor III
Author

Nope, it doesn't work. It returns me nothing (and I think the formula is missing the Sales_ID variable, isn't it?).

Contributor III
Author

Tried FirstSortedValue(date(\$(=year(today()))), Sales_ID) but still doesn't work.

It returns me nothing.

MVP

@rm1  If you have year field in your data then you can try below

``=FirstSortedValue( distinct{<Year={"\$(=year(today()))"}>}SalesID, Date)``

Contributor III
Author

Solved using:

FirstSortedValue ({1<year = {\$(=year(today()))}>} distinct date, date)