Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Search with greater than ">" variable

Hi,

I wanted to create a button that specifies a search on a field.

The field is "AGE" and the search should be "> vAGE_TRES".

"vAGE_TRES" is a variable and defined as 20.

The problem is that it does not work! When I specifiy "= vAGE_TRES" it accepts the variable and its value, but when I use greater than ">" it does not work.

Any idea?

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm assuming you are using a V9 action of "Select in Field". Try the following as the Search String in the Action:

='>$(vAGE_TRES)'

-Rob

View solution in original post

8 Replies
Not applicable
Author

Your search probably should be

"> $(vAGE_TRES)"

That will change your variable back to a number

= is probably working as a string compare

Not applicable
Author

Also "> $(vAGE_TRES)" does not work.

Not applicable
Author

Hi,

I think you can use a macro to solve the problem something like this in VBS:

sub searching


SET f = ActiveDocument.GetField ("YOURFIELD")

f.Select "YourVariable "

end sub

Maybe it will work

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm assuming you are using a V9 action of "Select in Field". Try the following as the Search String in the Action:

='>$(vAGE_TRES)'

-Rob

Not applicable
Author

hi, you an use the following as a macro in your application

sub period

str = ActiveDocument.Variables("vAGE_TRES").GetContent.String

mySelect= ">" & str

ActiveDocument.Fields("Age").Select mySelect

end sub



thanks

Not applicable
Author

Thanks Rob, your solution

='>$(vAGE_TRES)'

worked!

I didn't try the macro yet.

coert
Contributor
Contributor

I tried it as well, and it works like a charm......tried for hours and always ended in a dead end street.

Can you maybe explain what the $ does in the equation?

Thanks - Coert

Not applicable
Author

The $ just evaluates the variable.