Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

baptiste_genin
New Contributor

How To : get a value in a field according to values in other fields

Hi everyone,

I'm trying to find a way to create a field from data located in other fields.

Basicly, form the table below, How can i find the latest value for the item 1 if the message is B.

The result should be 10.

 

DateID itemMessageValue
25-mai1B10
24-mai1A5
23-mai1B3
22-mai1B7
21-mai2A1
20-mai2A7
19-mai2C6

For information, this operation is done in the script. All the values found are then put together in a field in order to easily find them in qlik sense when a ID item is called.

Thank you for your time,

Baptiste

2 Replies
MVP
MVP

Re: How To : get a value in a field according to values in other fields

You want to do this in the script? You want to store this in a new column? May be this

Left Join (TableName)

LOAD [ID item],

     [Message],

     FirstSortedValue(Value, -Date) as Recent_Value

Resident TableName

Group By [ID item], [Message];

baptiste_genin
New Contributor

Re: How To : get a value in a field according to values in other fields

Thank you.

After a few tries, This works :

load "ID item"

FirstSortedValue([value],-if([message] like 'B' ,[date]))

As "value of interest"

resident TableName group by "ID item";

Baptiste