How to fix the syntax error

Hi all, I created dynamic field ‘Tye’ in parameter, while creating calculated filed i am getting syntax error as shown in image. I tried but i couldn’t able to figure the error. can any one help me in identifying the same.

HI @sbaskax - Can you please try to use below forumla.

ifelse(${Tye} = [“Week”], {Week}, ${Tye} = [“Month”], {month}, {Qtr})

Also please check the parameter name and field values ensure they are correct in terms of case sensitive. If you are still facing issue. Please provide more details on the parameter as well.

Tagging QuickSight experts
@Max @apjvinod @thomask @Thomas @Kristin @David_Wong @Biswajit_1993 @Bhasi_Mehta @Tatyana_Yakushev

Regards - San

Hi Sanjeeb, I tried as suggested but still i am getting error

parameter details

Hi @sbaskax, Now it is fine or you are still having some issues.

No Biswajit, Still i am getting error

Hi @sbaskax - Can you please give a screenshot of field details?

Regards -San

Hi @sbaskax do you have all the three column like Year, Month, Week in your dataset?

Yes, i have week, month & Qtr (calculated field)

Hi Sanjeeb,
Pls find the fields screeshot

Hi @sbaskax - Thanks. Can you please try the below formula.

ifelse(${Tye} = [“Week”], {week}, ${Tye} = [“Month”], {month}, {Qtr})

Regards - San

Sorry Sanjeeb, still i am getting error

Hi @sbaskax - Please copy the formula to notepad and replace double quote present in formula with actual double quote as this copy paste from the blog is not actual double quotes.

Please try this once.

Regards - San


month and week are integers and Qtr is a String.
Every result of an ifelse function needs to be of the same datatype.

1 Like

Thanks @thomask , really good observation , that is why we called you “Expert”. I am trying multiple things and miss this point. my bad :slight_smile:

Regards - San

1 Like

Thank you Thomask, it works after changing the datatype of Qtr

1 Like

Thank you sanjeeb for your support

Thanks @sbaskax . Can you please mark @thomask suggestion as solution so that it can help other people in the community.

Regards - San

Sure, but in visualisation i am getting below erro

Hi @sbaskax - Can you refresh the SPICE again to update the data type.

Regards - San