Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
asinghal0412
Partner - Creator
Partner - Creator

Adding text to fields in if condition

Dear Qlik Community,

I have a code below:

=if([Calendar Year]= year(today()),[Calendar Year/Month])

which gives the solution:

Jan 2021Feb 2021Mar 2021Apr 2021May 2021Jun 2021Jul 2021Aug 2021Sep 2021Oct 2021Nov 2021Dec 2021

 

I want to write a code to give below as a solution

Jan 2021 Actual

Feb 2021 ActualMar 2021 ActualApr 2021 ActualMay 2021 ActualJun 2021 ActualJul 2021 ActualAug 2021 ActualSep 2021 Actual

Oct 2021 Actual

Nov 2021 ActualDec 2021 Actual

 

I tried the code below but it does not work

=if([Calendar Year]= year(today()),[Calendar Year/Month]+'Actual')

Can anyone share how to achieve this goal?

Thanks,

Akash

2 Solutions

Accepted Solutions
GaryGiles
Specialist
Specialist

You need to use & instead of + for text.

=if([Calendar Year]= year(today()),[Calendar Year/Month]&'Actual')

View solution in original post

MayilVahanan

HI @asinghal0412 

For concatenate the string, you need to use "&" symbol in Qlik

=if([Calendar Year]= year(today()),[Calendar Year/Month] & ' Actual')

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
GaryGiles
Specialist
Specialist

You need to use & instead of + for text.

=if([Calendar Year]= year(today()),[Calendar Year/Month]&'Actual')

MayilVahanan

HI @asinghal0412 

For concatenate the string, you need to use "&" symbol in Qlik

=if([Calendar Year]= year(today()),[Calendar Year/Month] & ' Actual')

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.