Holding state in an expression tag

I want to hold the current value in an expression tag if none of my expressions are true. how do I do this?
Thanks

show us an example of what you are trying to do.

An example would be great.

At first blush, a it may be easier set this up in a transaction group. I had briefly mentioned them in your other post. While most think about transaction groups as being used exclusively with the database, in truth, you can also use them to manipulate tags. 8)

don’t have an example yet. basically, trying to show a value based on time of day. and when time of day expression is not true. I want to hold the last value when the expression was true.
basically an if statement except no false return. if its false just hold what ya got.

Just make the property expression refer to itself if the condition is false.

Say you have a component property at: rootContainer.label.text

Then use this expression:

if(some condition, some value, {Root Container.Label.text})

If the condition is false then the current property value does not change.

Here is an example with a Numeric Text Field. It will only display even seconds – holding on to the last even number when the current second is odd:

if(dateExtract(now(),"second") % 2 = 0,dateExtract(now(),"second"),
{Root Container.Numeric Text Field.intValue}) 

I put the above expression on the Root Container.Numeric Text Field.intValue property.

I see you specifically asked about doing this in an expression SQLTag.

The same method works in an expression tag. Refer the tag to itself to hold the current value if your condition is false. Let’s say we have a tag at the path “test”.

This expression works in the tag:

if(dateExtract(now(),"second") % 2 = 0,dateExtract(now(),"second"),
{[~]test})