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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 2575 views
  • 0 likes
  • 2 in conversation