Random rows for a view

Kevin shared this question 7 months ago
Completed

I am trying to put together a report that show random rows from a yellowfin data model. The problem I am having is I am needing to pass into the data model a LIMIT value for the number of rows that are to be returned.


The SQL for this is very simple.


SELECT UserMnemonic

FROM Given_Table

ORDER BY RAND()

LIMIT ##


I have tried putting this SQL in as a virtual table into the data model. I then went in a created a parameter on the same model with a default value of 10. But there does not seem to be a way to reference the parameter from the SQL for the virtual table. The plan was I could expose this parameter on the report allowing the end user of the report to adjust the number to be returned to the report.


This can be done with a stored procedure, but the problem there is I have other filters on the report that need to be able to have a list of data values to filter with on this report. If you change the view to use a stored procedure, I no longer have this functionality to choose multiply items on a given prompt for a filter.


Is there a way that this can be done within yellowfin?

Replies (6)

photo
1

Hello Kevin

We have the option to set the row limit within Yellowfin. This can be done by changing the usage parameters in the data source, which is equivalent to going to the Administration > Admin console > Data Sources > Connection > Usage Parameters. Please refer to the link below for more details regarding the row limit.

https://wiki.yellowfinbi.com/display/yfcurrent/Understanding+Connection+Parameters

9b2a53261fb4ffe0e4e9f8d661927c01


Is this what you are looking for? Please let us know if anything else comes up that we can help you with.

Regards

Siddhartha

photo
1

No this is for a specific connection. I would like this to be done by report like you would with a fiter. I would like this pull up the report and be able to run this for 10 users. I would then like to be able to run it with 20 users. What i am asking for is there a way to pass into the data model or report and way to limit the number of rows return for the execution of that report.

photo
1

Hello Kevin

I have reviewed all the articles, but unfortunately, it is not currently possible within Yellowfin to limit the number of rows returned for the execution of a report in the data model or report. Kindly share any business requirements you may have so that I can submit an enhancement request to the product team.

Regards

Siddhartha

photo
1

Hello Kevin

Hope everything is good

I just want to touch base to see if you had a chance to read through the below response. If you can let us know that would be great.

Thank you,

Siddartha Pathi

Yellowfin Technical Support

photo
1

Yes I seen your comment. I was able find a solution to this opportunity. I was able find a way to query random rows from a given table and then limit the number of rows returned. Then using those result pull the final set of data that is needed for the report. So in the end I can pass in a number of random rows to return and then using that information pull the needed results. Thank you for looking into this and this case can be closed.

photo
1

Hello Kevin

Hope everything is good.

Thank you for the confirmation. I am glad to hear the issue was resolved. I will now mark this case as completed. We will keep you informed of any updates or developments regarding this feature within the Yellowfin UI. If you have any other issues, please contact us by opening a new ticket, and we will provide additional support.


Thank you,

Siddartha Pathi

Yellowfin Technical Support

Leave a Comment
 
Attach a file