Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

First/Last value in field

Hello all,

My question might be really trivial, but still I need to ask 🙂

Let's consider following table:

ACTIVITY ID, ACTIVITY NAME, MODEL

ACT_1, Activity One, Model_1

ACT_2, Activity Two, Model_2

ACT_3, Activity Three, Model_3

What function I should use to find the last value of MODEL sorting by the ACTIVITY ID.

I'm looking for the chart function.

Thank you very much for your help.

Best regards,

JTPro

4 Replies
stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

Look in the help file for the function firstsortedvalue

Stephen

Not applicable
Author

Hi,

Thank you very much for response.

I have already looked in the description of the firstsortedvalue function, but there is restriction that sort-weight must return numeric value. In my case it is a string sort-weight.

Can you write the expression that would do what I want?

Looking forward to hear from you.

Kind regards,

JTPro

stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

I would probably load in a sort value via the script.


Data1:
Load * INLINE [
ACTIVITY ID, ACTIVITY NAME, MODEL
ACT_4, Activity Four, Model_4
ACT_3, Act 3.2, Model_3
ACT_1, Activity One, Model_1
ACT_2, Activity Two, Model_2
ACT_3, Activity Three, Model_3
];
Left Join (Data1)
Load
RowNo() As Sort,
[ACTIVITY ID],
Count([ACTIVITY ID]) AS NeededAggregation
Resident Data1
Group by [ACTIVITY ID]
Order By [ACTIVITY ID];


Regards,

Stephen

Not applicable
Author

Hi,

Thank you very much.

It works just perfect.

Kind regards,

JTPro