Skip to main content
Solved

Business Reporter -Using wildcard in a report parrameter

  • January 11, 2023
  • 6 replies
  • 210 views

Forum|alt.badge.img+2
  • Do Gooder (Partner)
  • 7 replies

Has anyone come across a way of using a wildcard (‘%’ OR ‘*’) in the report Parameters so the user can select all without having to type the individual values? 

 

They may need to run the report with one value in the parameter or  with no filter so it gets everything pulling through.

 

Any advice is appreciated. 

Cheers

Best answer by 12Guide_PaulB

Hi,

 

I normally select ‘%’ as default value in the parameter defintion and then apply condition 'LIKE &Parameter’.

 

Best regards, Paul

View original
Did this topic help you find an answer to your question?

6 replies

12Guide_PaulB
Hero (Partner)
Forum|alt.badge.img+9
  • Hero (Partner)
  • 42 replies
  • Answer
  • January 11, 2023

Hi,

 

I normally select ‘%’ as default value in the parameter defintion and then apply condition 'LIKE &Parameter’.

 

Best regards, Paul


Forum|alt.badge.img+11
  • Hero (Partner)
  • 100 replies
  • January 11, 2023

-- Same answer already given 😀


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Partner)
  • 7 replies
  • January 11, 2023
12Guide_PaulB wrote:

Hi,

 

I normally select ‘%’ as default value in the parameter definition and then apply condition 'LIKE &Parameter’.

 

Best regards, Paul

Cheers Paul, twice you have helped me! Does the like statement still allow for multi values if I enable it in the Parameter area ? 

 

I had for got to say there could be 3 scenarios

  1. single value
  2. Multi selected values 
  3. everything 

As state above I'd imagine it will work. 

 

Thanks for all your help! 


12Guide_PaulB
Hero (Partner)
Forum|alt.badge.img+9
  • Hero (Partner)
  • 42 replies
  • January 11, 2023

Hi,

No, you cannot use multiple values in combination with the like statement. If you use multiple values, you can use the IN condition instead. Combining both conditions (LIKE and IN) would be very useful but  isn’t possible as far as I know.

Cheers, Paul


Forum|alt.badge.img+2
  • Author
  • Do Gooder (Partner)
  • 7 replies
  • January 11, 2023
12Guide_PaulB wrote:

Hi,

No, you cannot use multiple values in combination with the like statement. If you use multiple values, you can use the IN condition instead. Combining both conditions (LIKE and IN) would be very useful but  isn’t possible as far as I know.

Cheers, Paul

Ah that’s a shame, Maybe a future feature. Thanks for your help!


Forum|alt.badge.img+4
  • Do Gooder (Employee)
  • 24 replies
  • January 12, 2023

Hi!

I think you should be careful with LIKE ‘%’ since LIKE can be very bad from a performance perspective.

BETWEEN can also be bad from a performance perspective. You shoud try to stick with = and IN.

Instead of LIKE &parameter and default value beeing ‘%’ I would use the “ALL” functionality.

The filter would be IN &parameter and the default value for the parameter would be ALL.

When using the “ALL” functionality and value the WHERE statement would not be added to the final SQL -statement. There could be a big difference in the performance when leaving out the WHERE statement for the filter instead of having a WHERE statement with LIKE ‘%’.

/Stefan 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings