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

get first 2 characters of field and add '20' as year

Hi All,

I currently have this STRM1 data, where 1220 represents term 2 of year 2012, 1420 represents term 2 of year 2014 and so on. What i want to be able to do is to get the first 2 characters of the field and add a '20' in front to display as year.

For e.g:

get first 2 characters from STRM1 , 1220, '12', will be retrieved

Then add a '20' in-front , to show as 2012 in a new column

[Cell Name]


STRM1
1220
1420
1430
1510

Anyone can help?

Thank you for your time.

1 Solution

Accepted Solutions
achettipalli
Creator
Creator

='20' & left(STRM1 ,2)  as Year  // since some of those values are like 1430, 1510

View solution in original post

4 Replies
m_woolf
Master II
Master II

In script:

num(right(STRM1,2) & left(STRM1,2)) as Year

achettipalli
Creator
Creator

='20' & left(STRM1 ,2)  as Year  // since some of those values are like 1430, 1510

Anonymous
Not applicable
Author

This works fine! Thank you so much for your help.

Anonymous
Not applicable
Author

Thank you for your reply!