Quantcast
Channel: SCN : Document List - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 401

RANK in BODS using gen_row_num_by_group() function

$
0
0

Hello,

 

I am trying to explain Ranking in BODS. It plays very important role when your Business Requirement asks you to get most recent value within a group of values. We have a function called gen_row_num_by_group function() in BODS. With the help of this function you can generate RANK and then get Recent or Last value.

 

Go through the screens, it will tell you every step that you have to follow.


For Example:  Let’s take a scenario a customer has ordered few products on different dates. Now your business requirement wants to pick most recent date from Order date.

Now what you need to do is put order date in order by. That could be Ascending order.

 

RANK.png

 

Now Add a column you can name it as RANK and then map oreder_no with gen_row_num_by_group() function. It looks like below screen.

 

2.png

 

Now you run the job, you will get result like below table.

 

3.png

 

Now create another DF and make RANK TABLE as source. Map Oreder_date with max() function to pick most recent one. You would need group by Clause.

 

4.png

 

 

You have successfully generated RANK and picked up most recent date. Your result would look like below tables.

 

5.png

 

Regards,

Imran


Viewing all articles
Browse latest Browse all 401

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>