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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
yanivvl0
Creator III
Creator III

How to show previos appearance before the last - with(out) selection ?

hi to all , I summarize in the text box the units where year = 2016 and Category = 4, by clicking it i am activating a selection according to this 2 fields.  Once selected  i need to see the last status (by model_Proj_STATUS_NUMBER in descending order) - so far no problems, but when I want to see the status before him - WITHOUT consideration of year and Category I get nothing :

prev last status _  2016 2.PNG

The Requested values below are highlighted in yellow:

prev last status _ 2016.PNG

you can use the attach QVW. 

THANKS!!

16 Replies
sunny_talwar

I am not sure as well on what you are trying to achieve. Would you be able to provide the output in a table form with and without the selections?

perumal_41
Partner - Specialist II
Partner - Specialist II

Try below

  FirstSortedValue (  {<model_STATUS_DATE_FROM_Year= , model_Category= >}  model_Proj_STATUS , model_Proj_STATUS_NUMBER,2 ) 

yanivvl0
Creator III
Creator III
Author

hi again Sunny , i think your answer is GOOD !!   i got confuse , it seems to work OK !!

yanivvl0
Creator III
Creator III
Author

hi Maxim , You're right, I just had to digest the process of calculation - THANKS !!

yanivvl0
Creator III
Creator III
Author

hi Sunny , I hope you do not mind to take a look in one more question related to the discussion,   is it possible to eliminate the projects ( "model_Proj" ) that do not have a case of the year = 2015 Category = 4, in other words where the "last status" is NULL.    Again - many thanks!

sunny_talwar

Try this expression:

=If([last status] > 0, FirstSortedValue({<model_Category = {"$(='<=' & Max(model_Category))"}, model_STATUS_DATE_FROM_Year = {"$(='<=' & Max(model_STATUS_DATE_FROM_Year))"}>}  model_Proj_STATUS , -model_Proj_STATUS_NUMBER, 2))

Capture.PNG

yanivvl0
Creator III
Creator III
Author

AMAZING !    i did not know that in QV there is a possible to ask about any expression from another expression ,

you are a good teacher , and exelant developper !!