Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikuser22
Creator II
Creator II

Find middle value in a column and pick the other corresponding values

Hi

I have a table of date fields and the difference between dates are calculated. 

qlikuser22_0-1650455689759.png

Step 1: I want to sort the values in (Completed - Started). 

Step 2: I want to find the middle of (Completed - Started) and just pick the corresponding values from other columns(like Request-Started, Request - working, working-completed). 

Example:

Middle(Completed-started) = 15

Request-Started = 14

Request-Working = 0

Working - Completed = 1

I need these results as a KPI. 

 

Is this possible using qlik expression. ?

I tried using only expression, but it didn't help.

Any help.

 

Thanks in advance.

 

Labels (1)
5 Replies
vinieme12
Champion III
Champion III

please post some sample data

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
qlikuser22
Creator II
Creator II
Author

Hi @vinieme12 

The above image is the sample data. It's exactly the same case. Please do help. 

vinieme12
Champion III
Champion III

please post it in excel

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
qlikuser22
Creator II
Creator II
Author

Hi @vinieme12 

Thanks for the reply. Please find the attached excel. 

 

Thanks in advance!

 

HugoRomeira_PT
Creator
Creator

Hello @qlikuser22 

 

In this specific scenario I believe you can use the FirstSortedValue() function:

Example using your data set:

FirstSortedValue([Completed - Started], [Completed - Started] ,round(Count(distinct ID)/2,1))
Note: Change the [Completed - Started] with the values you which to retrieve.

HugoRomeira_PT_0-1653060915764.png

 

See the result bellow:

HugoRomeira_PT_1-1653061077979.png

 

Hope it helps!

 

If the issue is solved please mark the answer with Accept as Solution.
If you want to go quickly, go alone. If you want to go far, go together.