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: 
annanirvin
Contributor III
Contributor III

Min and max dates

Hi all.

I have a table like this

EIDFROMTO
A2017-12-212019-05-07
A2018-05-082018-05-08
A2018-05-092018-07-31
A2018-08-012019-09-30
B2018-04-032018-07-27
B2018-08-272019-01-24
B2018-08-272019-07-31

 

and I would like the result look like this

EIDFROMTO
A2017-12-212019-09-30
B2018-08-272019-07-31

 

My coding skills are limited, is there anyone who can guide me here, please?

8 Replies
santhiqlik
Creator
Creator

Hi, Do you want to display Min or Max From date ? I see that you are displaying Min From date for EmpId A and Max From date for EmpID B. Could you please clarify.
jonathandienst
Partner - Champion III
Partner - Champion III

Create a table/pivot with EID as the dimension; Min(FROM) and Max(TO) as expressions/measures.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
annanirvin
Contributor III
Contributor III
Author

Sorry, I was unclear. I want Min FROM date for the last unbroken date range, which for B also happens to be Max FROM date.

annanirvin
Contributor III
Contributor III
Author

Thanks, but wouldn't that give me 2018-04-03 for B which is not the date I want?

nilaksh92
Partner - Contributor III
Partner - Contributor III

Hi 

 

Please have a look over the attached qvw file.

 

This might solve your problem.

 

Thanks

Nilaksh Mahajan

annanirvin
Contributor III
Contributor III
Author

Thanks, but that's not really what I'm looking for. Max for B should be 2018-08-27.

Any other suggestions?

nilaksh92
Partner - Contributor III
Partner - Contributor III

Hi

 

Please find the attached file.  (Final Table)

I am able to achieve what you need.

annanirvin
Contributor III
Contributor III
Author

Thanks again for your efforts, but it's still not really the solution I'm looking for, I have hundreds of IDs and thousands of rows in my table.