Qlik Community

Ask a Question

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 
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!

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
Creator III
Creator III

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.

Kush
MVP
MVP

@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!

View solution in original post