Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4321 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm trying to create a dynamic SELECT set up by way of the Let function where the SELECT values are the results of Let variables. The problem is that sometimes these values equal "all" or "empty". In these cases, I basically just want to ignore that value in the WHERE criteria. I tried setting it up using a Case function so that if the value equaled "all" or "empty" the result would be an "*" but that didn't return anything. 

 

Let([

 

$a = Case(

FieldValue1 = "all" or FieldValue1 ="empty"; "*";

FieldValue1);

 

 

$b = Case(

FieldValue2 = "all" or FieldValue2 ="empty"; "*";

FieldValue2)

 

];

 

SELECT

FieldA,

FieldB

 

FROM

Table

 

WHERE

$a;

$B)

Posted

You can have the word "WHERE" be conditional as well if it equals all or empty.

  • Like 1
Posted

Right! I don't know how I overlooked that trick but I'm pretty sure it will go a long way to simplifying my calcs/scripts. 

 

Thanks again!

This topic is 4321 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.