Ifelse help

I am having some issues getting an Ifelse syntax to work for me.

ifelse({Asset} = ‘X’ AND {Date Inventoried} >= ‘Jun 18 2023’, ‘yes’)

I am trying to flag when an asset hasnt been inventoried in over 30 days.

Any help would be appreciated.

You need to define a value when the condition is not satisfied:

ifelse({Asset} = ‘X’ AND {Date Inventoried} >= ‘Jun 18 2023’, ‘yes’, ‘no’)

Thank you for the response and recommendation.

Unfortunately the error I am receiving now is “at least one of the arguments does not have the correct type”.

Hi @Bryan - Can you share sample data and data types of those columns.

This will help in replicating the issue at our side and provide you the right solution.

Regards - Sanjeeb

For sure the asset data is strings like ‘G-100’, ‘G-200’ etc. The date inventoried is just dates in the above format ‘Jul 1 2023’ etc.

If there is another function I should be using please let me know that as well. I am a novice user of visualizing data to make dashboards and heavily relying on reading examples and trying to replicate/implement concepts.

Can you check the data type for your date field? If it’s a string, you have to change it to a date so that you can use the “greater than or equal to” operator.

It was a date just switched the format to read ‘07-01-2023’ to see if that made a difference, however still showing syntax issue.

ifelse({Asset} = ‘G-100’ AND {Date Inventoried} >= ‘06-18-2023’, ‘yes’, ‘no’)

Can you try ‘2023-06-18’?

Just tried and same error

ifelse({Asset} = ‘G-100’ AND {Date Inventoried} >= ‘2023-06-18’, ‘yes’, ‘no’)

That’s weird. Can you show a screenshot of the date field in your dataset like this so that I can see the format?
image

Screenshot 2023-07-19 at 4.37.03 PM

The date looks good.

Let’s try the 2 conditions separately and see which one has the error.
ifelse({Asset} = ‘G-100’, ‘yes’, ‘no’)
ifelse({Date Inventoried} >= ‘2023-06-18’, ‘yes’, ‘no’)

It is the date that is giving the issues. Doing the asset by itself worked no problem, and worked as it should.

The date is giving the syntax issue.

It works fine for me.
image

Do your values show in green like in the above screenshot? I’ve noticed before that sometimes if I copy and paste text, I get curly quotes instead of straight quotes as below and that gives a syntax error.

You are correct the copy paste got me, thank you so much for all your help.

Thanks @David_Wong . Good to see this issue is finally resolved…

Regards - Sanjeeb