Error Message | Data Preparation

Hi all,
i am preparing a dataset and need to add calculated fields within the dataset.
I already added a few and it works, but when i add the following, it throws the following error message:

The calculation i am adding is the following:
substring({problem_description},
locate({problem_description}, 'Error text sgbd: ') + 17,
ifelse(
(contains ({problem_description}, ‘Error message’) = ‘false’),
(locate({problem_description}, ‘Test Stand’)) - (locate({problem_description}, 'Error text sgbd: ') + 17),
(locate({problem_description}, ‘Error message’)) - (locate({problem_description}, 'Error text sgbd: ') + 17)
))

I added similar calculations which work fine (but there are no ifelse-functions).

NOTE: This Calculation works fine in analysis. Only in Data-Set preparation the error occurs.

Can some please help me troubleshoot?
Thanks :slight_smile:

Hello @JulianBr , welcome to the Quick Sight community!

Starting with the error message, what data source are you connecting to and are you performing any joins in Quick Sight? Also, are you using SPICE or direct query? My first thoughts here based on the error, but that this still works in the analysis is a few things: 1) There might be a limitation on what function you can do against the data source 2) Something is up with the data coming from your data source in Quicksight possibly because of a join and 3) You are able to achieve this in your analysis because the data is stored in SPICE.

You could also try breaking the calculation apart. So first create the ifelse statement and then try adding that to your substring calculation.

Hi @duncan,

the dataset comes via Amazon Athena.
And no, currently this dataset is not joined. But the calculated field is set up to make a join to another dataset possible.

Query Mode is SPICE.

I tried only the ifelse statement and error occurs.

Hey @JulianBr !

If you are getting the dataset from Athena I would recommend doing the calculation there in a view.

1 Like