Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rm1
Contributor III
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 (4)
1 Solution

Accepted Solutions
rm1
Contributor III
Contributor III
Author

Solved using:

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

thanks Everyone for your hints!

View solution in original post

6 Replies
sunny_talwar

You can try this

Min({<Year = {"$(=Year(Today()))"}>} Date)
NitinK7
Specialist
Specialist

try once using firstsortedvalue 

rm1
Contributor III
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?).

rm1
Contributor III
Contributor III
Author

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

It returns me nothing.

Kushal_Chawda

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

 

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

 

 

rm1
Contributor III
Contributor III
Author

Solved using:

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

thanks Everyone for your hints!