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: 
Mattia
Creator II
Creator II

How can i write an expression with if statement, applymap and left() / right() functions?

Hi guys,

attached is a sample data file (is a personal/desktop) edition.

The output i want to obtain is the following:

if field5 = 0,  the first 5 number of field4 and the last two of the same field.

applymap and left() / right () functions can coexist?

Thanks,

Mattia

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

May be this

If([FIELD5] = 0, Left(ApplyMap('KEY_TO_FIELD4', [FIELD2], 'n/a'), 7) & ',' & Right(ApplyMap('KEY_TO_FIELD4', [FIELD2], 'n/a'), 2)) as New_Field

View solution in original post

1 Reply
sunny_talwar

May be this

If([FIELD5] = 0, Left(ApplyMap('KEY_TO_FIELD4', [FIELD2], 'n/a'), 7) & ',' & Right(ApplyMap('KEY_TO_FIELD4', [FIELD2], 'n/a'), 2)) as New_Field