Set BAQ Top Clause from User Variable at Runtime

Hi All!
I have a BAQ that returns a lot of rows into a dashboard view. This allows me to run a custom action on the resulting BAQ rows. However, since there are so many rows, I would like an option to process only the top X records. This should be a user defined parameter. I could either define the parameter in the BAQ parameters, or using a customization.

The BAQ “TOP” clause only allows me to enter a constant value. Is there a way to set the TOP clause to look at a BAQ parameter?

What do you think?
Thanks for your time!
Nate

You could create a calculated field in your BAQ, that contains sequential numbers (1, 2, 3…) and have the Dashboard Filter off of that (using Calc_Field <= User_Param)

2 Likes

Is there an easy way to accomplish this calc field? I seem to recall a running total or something, but I can’t find it in my calc editor.

I created a calculated field with this formula: (note, I had to add the company table)

Row_Number() over(partition by Company.Company order by Company.Company)

This did the trick. Thanks!

2 Likes