Skip to Content

Ranking Function in WEBI?

Hi Experts,

I have a weird requirement in WEBI. i have three tables it contains Dimension and Measure.

Now my requirement is if its a Rank one then i need to put these record into one table after that if its a Rank 2 then i need to display only second record into another table. Whenever i am applying Rank 2 it is bringing two records i.e., Rank 1 and Rank 2 but i need to get only second record (i.e., Rank 2 record).

Is there a way to achieve this?



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Dec 16, 2015 at 11:54 AM

    Hi Sudha,

    Can u pls attached screen shot or elaborate the scenario.



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Sudha,

      I did the below and it works (with one minor issue that I didn't spend time on) for your requirement.

      • Create variable v_Rank = Rank([Amount])
      • Create variable v_Rank1 =If([v_Rank]=1) Then 1 Else 0 (This is used as a flag)
      • Create variable v_Rank2 =If([v_Rank]=2) Then 1 Else 0 (This is used as a flag)
      • Create variable Select a Rank =1 (We'll create Input Control on this object, so, 1 becomes default selection)
      • Create a Input Control -> Single Value -> Entry Field and you'll see that the Default value(s) is 1

      • Now, you'll see that Select a Rank value will be equal to the value you enter in the input control.
      • Create a final variable v_Displayed Rank =If([Select a Rank]=1) Then [Cust ID] Where ([v_Rank1]=1) ElseIf([Select a Rank]=2) Then [Cust ID] Where ([v_Rank2]=1)
      • Add v_Displayed Rank to the table and filter on it as v_Displayed Rank Is Not Null.
      • Now when you enter 1 in the filter and click OK, you'll see Rank1 row is displayed and when you enter 2 in the filter and click OK, you'll see Rank2 is displayed.

      Note: As a test, add all the variables we created to the table including Cust ID & Amount to see what each variable does.

      That's it, try if its working fine. Let me know if this helps and/or if you have any questions.


      Mahboob Mohammed

      Select a Rank.PNG (23.0 kB)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.