Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

in date field I have 10 dates .. I want to copy the first date value to a variable

in date field I have 10 dates .. I want to copy the first date value to a variable

3 Replies
Not applicable
Author

In Script?

So try to use these examples:

returns the value of Sales from the first record read into the current internal table.

peek( 'Sales', 0, 'Tab1' )

or

peek( 'Sales', 0)


You could specify the table name (first one), if desire a value from a specific table, or omit it, to get the value on all tables having this field.




buzzy996
Master II
Master II

read this & try,

firstsortedvalue ( [ distinct ] expression [, sort-weight [, n ]] )

returns the first value of expression sorted by corresponding sortweight

when expression is iterated over a number of records as

defined by a group by clause. Sort-weight should return a numeric

value where the lowest value will render the corresponding value of

expression to be sorted first. By preceding the sort-value expression

with a minus sign, the function will return the last value instead. If

more than one value of expression share the same lowest sort-order,

the function will return null. By stating an n larger than 1, you will

get the nth value in order. If the word distinct occurs before the

expression, all duplicates will be disregarded.

Example:

Load Customer,

firstsortedvalue(PurchasedArticle, OrderDate)as

FirstProductBought

from abc.csv group by Customer;

Not applicable
Author

hii

try this expression


firstsortedvalue()