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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create new field with multipel fields as input

Hi

I want to create a new field with input from multipel other fields as shown below.

timestamp1timestamp2timestamp3timestamp4
ab
a
abcd
abc

Timestamp1-4 are always filled in the order a, b, c to d (timestamp2 can not have a value without a value in timestamp1)

Now I want to create a new field "result" to show the highest timestamp value.

example

a and b -> b

a, b and c -> c

Result
b
a
d
c

Thank you in advance!

Best regards

Malte

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

try: if(timestamp4,timestamp4,if(timestamp3,timestamp3,if(timestamp2,timestamp2,timestamp1)))


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Not applicable
Author

Hi,

You could add a statement like this in the script:

TableName:

Load *,



if(Time4>Time3 and Time4>Time2 and Time4>Time1 ,Time4),

if(Time3>Time4 and Time3>Time2 and Time3>Time1 ,Time3),if(Time1>Time3 and Time1>Time2 and Time1>Time4 ,Time1) as MaxTime

From SourceFile;

Hope that helps.

-Khaled

Not applicable
Author

You can also use the concat function:

Load Department, concat(Name,';') as NameList from abc.csv group by Department;

Kind Regards,

Dion

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

try: if(timestamp4,timestamp4,if(timestamp3,timestamp3,if(timestamp2,timestamp2,timestamp1)))


talk is cheap, supply exceeds demand
Not applicable
Author

Brilliant!

Not applicable
Author

Brilliant!