Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Case statement in Advanced SQL filter

725090Feb 3 2010 — edited Feb 9 2010
Hi,

I have two columns Vendors and their Sales

Vendor| Sales
------- | ---------
|

Sales is a measure. I have 4 more measures like this (sales, products, units etc). I need to create a report with two columns (one column is vendor and the other column is a measure) so that the second column changes dynamically on the dashboard. I can acheive this using Column selector. But my requirements demands to have TOPN prompt so that only top N vendors should display. Hence I created a presentation variable and mimcked the column selector functionality with a "Dashboard prompt as Column selector" (google dashboard prompt as column selector to verify how a dashboard prompt can be used as a column selector).
So finally I created a dummy column with Rank Function and arranged it in ascending order and applied the filter as (less than or equal as to the presentation variable)

so when we plug in, lets say, 5 the filter will apply to the Rank column and display the TOP 5 vendors.

Now, the real problem is...one of the measures requires the bottom 5 to display since the TOPN for that measure is calculated in descending order.
Hence in the filter I gave

Case when presentation variable = "measure" then bottomN else TOPN.... but it is returning an error...

Can you guys help me on this issue. If you dont understand the query exactly please ping me....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details