This discussion is archived
1 Reply Latest reply: Dec 12, 2012 9:21 PM by Srini VEERAVALLI RSS

How To Calculate TOPN variable...

962252 Newbie
Currently Being Moderated
Hi All,

I have display Top N Sales Dynamically.Like user enter 1 value it will display top 1 record or user enter 5 i want display top5.

How to Archive this requirement.....
  • 1. Re: How To Calculate TOPN variable...
    Srini VEERAVALLI Guru
    Currently Being Moderated
    In prompt pull Sales column->SQL Results
    use query something similar to below

    SELECT TOPN("Sales",10) FROM "SubjectArea" order by Sales

    @Set Variable->Select Presentation Variable and give name as N

    In your report at Criteria tab pull sales column and change the fx or expression as below

    TOPN("Sales", cast(@{N}{2} as int))

    This works for sure do the changes were ever required

    If works pls mark as correct else you might configured wrongly ;)


  • Correct Answers - 10 points
  • Helpful Answers - 5 points