Selecting Top N values ​​with dynamic typing a value N



Selection of N values ​​that meet a top criterion, Oracle BI is a very trivial task. We solve it by specifying filters typically a column that serves as the top criterion for selection. Filter enter the following:limitation of this solution is that the future user created this view of data does not necessarily see just 20 top values. We enter into the filter and another number, but I met with the case, however, that the customer wanted the number of rows in the selection - the value of N - to determine itself - ie dynamically. The solution that occurred to me, is to use a variable presentation. How can a variable presentation will define and fill, I will try to describe in the following example, when I have to use the Dashboard Prompt (restricted page).Sample standard business model illustrates the common links between facts and dimensions of the table. Because we need some logical column for a value "N", added I sense the logical Facts table column N, and put it into the value to 1 This will ensure that value as the default Data Type Int. N column I added to the presentation layer. Logical column N can now be used in the dashboard prompt. We check the consistency and save the repository. Log in to create and Answers Dasboard prompt. Its importance will be restricted to Page: prompt to add a column N. properly choose the value of columns Operator Control Default it (I chose a Specific Value = 1) Set Variable (variable I named X01) and write the text box label: Select value of N in heating. Default value is first graphically prompt dotvoříme: save it as Page_prompt1. yet to prepare a suitable query. We must not forget it in a column rank (Facts.Units), which indicates the order of the row in the selection and will serve as a filter, because the user will just enter the value of lineage. The highest ranking will actually indicate the number of rows returned. Filter condition for the column rank (Facts.Units) was created as follows: The default value of 1 is the fact that in the event that no value is specified variables X01, show just a single line. Question save as Select01 with prompt and placed on dashboards. The result should be the following: 1) If you do not prompt any value, the default is to set the filter value of 1 and selects a single line. 2) Conversely, if we enter as value 17, then the variable presentation (Presentation Variable) named X01 sets the value of 17 and selects the 17 found. Thus, the user can choose any number of top N rows.