Condition not working as expected in If Else function

Hi Team,

I am not sure, what is the issue is here. Initially, I have written a calculated filed and it is working as expected (Reference snap 1 & 2), however I would like to add couple of conditions to the existing calculated field (Refer Snap 3), after writing the rules, I am getting below error message, as shown in Snap 4. Could someone please assist me with this issue?. Thank you!

image


Hi @tdr_Dinesh,
This is interesting as your calculated field looks to be written out correct.
A couple questions in reference to this…
Are you creating this field on the dataset or analysis layer?
Are you running SPICE or direct query?
Is ‘overdue’ a calculated field as well (if so, could you share)?

It’s very possible that just refreshing the page and recreating the calculated field could help as well. Normally adding one extra ‘ifelse’ condition shouldn’t keep it from running.

Thank you!

Hi @Brett,

Would you please have a look into the below comments.

Are you creating this field on the dataset or analysis layer? - Created on the analysis Layer.
Are you running SPICE or direct query? - Direct Query
Is ‘overdue’ a calculated field as well (if so, could you share)? - Yes, it is a calculated field.

We have refreshed the page and recreated the calculated field, but no luck.

image

Thank you!

Hi @tdr_Dinesh,
I wonder if it may have something to do with your greater/less than statements. What if you tried the following instead:
OverDue >0 AND OverDue <=5
OverDue >=6 AND OverDue <=10
OverDue >=11 AND OverDue <16

In your statement, you’re not accounting for 5 anywhere as you have ‘less than’ in your first line and ‘greater than’ in the second line.

Hi @Brett ,

No Luck, still experiencing the same issue. Could you please have a look in to the below snapshot. Thank you!

Hi @tdr_Dinesh,
Is it a requirement to utilize direct query for the dataset? Would hourly or even 15 minute refreshes still meet the expectations for the dashboard?

Depending on the database you’re querying, the number of calculated fields you are using, and the complexity of the SQL statement that is building the dataset, it seems like this one change is causing the query to timeout.

Would you be able to move the calculated fields from the analysis to the custom SQL statement on ingestion or possibly even try to add them into the dataset directly? I would also be curious to see if the error went away on a duplicate dataset that is set to SPICE.

Hi @Brett ,

Yes, it is a requirement to update the incremental changes every 5 minutes. Most of the calculated fields are added directly to the dataset, while only a few are created at the analysis level.

Thank you!

Hi @tdr_Dinesh - are you getting the error immediately or after sometime of the execution. Also what is the data source and what is the volume of data for the direct query?

Also when this is timing out, is it possible to generate the extract sql execute in the source db. This will give some details around the sql generated by QS.

Regards - Sanjeeb

Hi @Sanjeeb2022 ,

Yes, we are getting the error message immediately, and the data source is Athena. Currently, we have around 135,000 records in the dataset.

Thank you!

Thank you for letting us know. I would recommend filing a case with AWS Support where we can dive into the details so that we can help you further. Here are the steps to open a support case. If your company has someone who manages your AWS account, you might not have direct access to AWS Support and will need to raise an internal ticket to your IT team or whomever manages your AWS account. They should be able to open an AWS Support case on your behalf. Hope this helps!