Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Emir_Peker
Contributor III
Contributor III

Error in Expression (IF STATEMENT)

Hello everyone,

Instead of showing JAN, FEB etc.  as Month, I want to show those months from my own language and I wrote the code below in expression. For some reason, the expression has an error expecting me to put " ) ". I tried many things to get rid of it but cannot seem to find it. So I need another pair of eyes to tell me, what I am doing wrong.

Emir_Peker_0-1607628240194.png

=IF([ORDER_DATE.autoCalendar.Month]={'Jan'},'01-Ocak', 
 IF([ORDER_DATE.autoCalendar.Month]={'Feb'},'02-Şubat',
 IF([ORDER_DATE.autoCalendar.Month]={'Mar'},'03-Mart',
 IF([ORDER_DATE.autoCalendar.Month]={'Apr'},'04-Nisan',
 IF([ORDER_DATE.autoCalendar.Month]={'May'},'05-Mayıs',
 IF([ORDER_DATE.autoCalendar.Month]={'Jun'},'06-Haziran',
 IF([ORDER_DATE.autoCalendar.Month]={'Jul'},'07-Temmuz',
 IF([ORDER_DATE.autoCalendar.Month]={'Aug'},'08-Ağustos',
 IF([ORDER_DATE.autoCalendar.Month]={'Sep'},'09-Eylül',
 IF([ORDER_DATE.autoCalendar.Month]={'Oct'},'10-Ekim',
 IF([ORDER_DATE.autoCalendar.Month]={'Nov'},'11-Kasım',
 '12-Aralık')))))))))))

 

2 Solutions

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

you dont need the curly braces {}. updated below

=IF([ORDER_DATE.autoCalendar.Month]='Jan','01-Ocak', 
 IF([ORDER_DATE.autoCalendar.Month]='Feb','02-Şubat',
 IF([ORDER_DATE.autoCalendar.Month]='Mar','03-Mart',
 IF([ORDER_DATE.autoCalendar.Month]='Apr','04-Nisan',
 IF([ORDER_DATE.autoCalendar.Month]='May','05-Mayıs',
 IF([ORDER_DATE.autoCalendar.Month]='Jun','06-Haziran',
 IF([ORDER_DATE.autoCalendar.Month]='Jul','07-Temmuz',
 IF([ORDER_DATE.autoCalendar.Month]='Aug','08-Ağustos',
 IF([ORDER_DATE.autoCalendar.Month]='Sep','09-Eylül',
 IF([ORDER_DATE.autoCalendar.Month]='Oct','10-Ekim',
 IF([ORDER_DATE.autoCalendar.Month]='Nov','11-Kasım',
 '12-Aralık')))))))))))

 

View solution in original post

Kushal_Chawda

@Emir_Peker  another optimized way to do it using pick match

=Pick(match([ORDER_DATE.autoCalendar.Month],'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),
'01-Ocak', 
'02-Şubat',
'03-Mart',
'04-Nisan',
'05-Mayıs',
'06-Haziran',
'07-Temmuz',
'08-Ağustos',
'09-Eylül',
'10-Ekim',
'11-Kasım',
'12-Aralık')

View solution in original post

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

you dont need the curly braces {}. updated below

=IF([ORDER_DATE.autoCalendar.Month]='Jan','01-Ocak', 
 IF([ORDER_DATE.autoCalendar.Month]='Feb','02-Şubat',
 IF([ORDER_DATE.autoCalendar.Month]='Mar','03-Mart',
 IF([ORDER_DATE.autoCalendar.Month]='Apr','04-Nisan',
 IF([ORDER_DATE.autoCalendar.Month]='May','05-Mayıs',
 IF([ORDER_DATE.autoCalendar.Month]='Jun','06-Haziran',
 IF([ORDER_DATE.autoCalendar.Month]='Jul','07-Temmuz',
 IF([ORDER_DATE.autoCalendar.Month]='Aug','08-Ağustos',
 IF([ORDER_DATE.autoCalendar.Month]='Sep','09-Eylül',
 IF([ORDER_DATE.autoCalendar.Month]='Oct','10-Ekim',
 IF([ORDER_DATE.autoCalendar.Month]='Nov','11-Kasım',
 '12-Aralık')))))))))))

 

Kushal_Chawda

@Emir_Peker  another optimized way to do it using pick match

=Pick(match([ORDER_DATE.autoCalendar.Month],'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),
'01-Ocak', 
'02-Şubat',
'03-Mart',
'04-Nisan',
'05-Mayıs',
'06-Haziran',
'07-Temmuz',
'08-Ağustos',
'09-Eylül',
'10-Ekim',
'11-Kasım',
'12-Aralık')
Emir_Peker
Contributor III
Contributor III
Author

Thank you both. Both solutions work, but I prefer optimized version 🙂