Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Last status per Source ID for random date selection

Hi

I am trying to get the last status for each Source ID for a random date selection in the front end (by the users).

For e.g. original data set is as follows:

Source ID

Status

Date

x                  

A             

01/01/2014

x                  

B             

02/01/2014

y                  

C             

03/01/2014

x                  

A            

06/01/2014

y                  

A             

08/01/2014

z

B             

10/01/2014

y                  

C             

12/01/2014

x                  

A            

18/01/2014

y                  

A             

21/01/2014

z

D

22/01/2015

x                  

A

25/01/2016

y                  

C             

27/01/2017

z

B             

29/01/2018

Now, if the user selects the date range from 03/01/2014 to 22/01/2014 then on Qlikview I want to show

Source ID

Status

Date

y                  

A             

21/01/2014

x                  

A            

18/01/2014

z

D

22/01/2015

            

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

3 Replies
MK_QSL
MVP
MVP

Check enclosed file.

Not applicable
Author

Hi Manish

Thank you for the feedback.

One more thing, how do i get a count (collectively for all the statuses).

So assuming this was the result:

Source IDFirstSortedValue(Status,-Date)FirstSortedValue(Date,-Date)
xA25/01/2016
yC27/01/2017
zB29/01/2018
uA29/01/2018
vA27/01/2017
wB25/01/2016
sB29/01/2018
rB25/01/2016
tC27/01/2017

How do i get this:

FirstSortedValue(Status,-Date)Count
A3
C2
B4
MK_QSL
MVP
MVP

File enclosed.