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

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
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

Labels (1)
4 Replies
stephencredmond
Partner - Specialist II
Partner - Specialist II

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
Partner - Specialist II
Partner - Specialist II

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