BookmarkSubscribeRSS Feed
GS10
Fluorite | Level 6

 

Hi,

 

I m trying to create a calculated fieldfor a report. I have to create an item with a range and I using If else boolean for this. Here, i have to get the output as numeric with combination of date and numeric. i m not able to create an item with date and range between numeric where as the ouput should be a nuemeric. Please suggest..

8 REPLIES 8
Sam_SAS
SAS Employee

Hello,

 

 

Can you provide some more information about the calculated expression that you want to create?

 

Do you need to compare numerics and dates?

 

It wouldn't be as simple as something like this would it?

 

IF ( 'Date'n BetweenInclusive('7MAR2017'd, '28MAR2017'd) )
RETURN 'Profit'n
ELSE .

Thanks,

Sam

GS10
Fluorite | Level 6
Yes..

IF ( 'Numeric'n BetweenInclusive('numeric', 'numeric') )
RETURN 'text string'n
ELSE .
Sam_SAS
SAS Employee
Are you getting a message about argument types not matching?

In the VA expression syntax, . is a numeric missing value and '.' is a character missing value. If your RETURN parameter is character, then try,

IF ( 'Numeric'n BetweenInclusive('numeric', 'numeric') )
RETURN 'text string'n
ELSE '.'
GS10
Fluorite | Level 6

Yes..

GS10
Fluorite | Level 6

Can someone solve this  ??

Sam_SAS
SAS Employee
Did you try putting quotes around the missing value for your ELSE statement?
GS10
Fluorite | Level 6

Thanks! Yes, I tried it and its working. 

Sam_SAS
SAS Employee

Great! Thanks for following up.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 1435 views
  • 0 likes
  • 2 in conversation