BookmarkSubscribeRSS Feed
Sam_SAS
SAS Employee

@sushviper1 wrote:

Hi @Sam_SAS ,

 

I tried above solution and created calculated filter along with advance filter , my input textbox having alphanumeric value like ABC123 . so i kept input textbox as Character . In advance filter i used below code 

 

IF (GetWord('Loan Account No'n)>0)
    RETURN (( UpperCase('Loan Account No'n) Contains UpperCase('Parm1'n) ) OR ( UpperCase('Loan Account No'n) Contains LowerCase('Parm2'n) ))
ELSE (1=1)
 
this showing me an error as Expected : Numeric constant ,numeric, date or datetime . i dont know how to resolve this issue .

Hello,
I think the main issue is with your IF condition -- GetWord() will return a string but you are comparing it to a number. Did you mean to use GetLength()?
Your RETURN clause has UpperCase(), but I think that should be UpCase(). Unless the name was different before VA 7.5.

Let us know if that helps!

Sam

sushviper1
Calcite | Level 5

"Loan Account no" contain alphanumerical values . 

Sam_SAS
SAS Employee

If the account number only contains number characters, you can use the TreatAs() operator to cast the values to numeric. If you have values like "12344A", then expression syntax cannot evaluate whether that is greater than zero.

sushviper1
Calcite | Level 5

Hi @Sam_SAS  so could you please provide a solution to overcome this issue ?

Sam_SAS
SAS Employee

@sushviper1 In your expression you are trying to compare a character value to a numeric one. The app cannot evaluate whether a character string is "greater than" zero.

 

It would be helpful if you could provide an example value from your Loan account number column.

sushviper1
Calcite | Level 5

Hi @Sam_SAS  please find table below 

 

sushviper1_0-1744371345731.png

 

 

 

Sam_SAS
SAS Employee

Thanks for sharing an example value.

I'm not sure I understand what you want to accomplish with your IF statement:


IF
 (GetWord('Loan Account No'n)>0)

 

What would be some values that would fail this check, if it was working like you wanted it to? Are you checking for missing values, or values that would just be "0"? If so, you could check for those in a different way.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 21 replies
  • 14586 views
  • 4 likes
  • 5 in conversation