Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
arulsettu
Master III
Master III

sort the table based on other field

Hi

     i am trying to achieve in straight table some thing like this

     dimension is drill down

     make

     model

     use

expression is finding ratio

sum(commission)/sum(amount)

now what i need is take the top ten ratio based on  vehicle count. that means highest vehicle count of ratio values should come.

for this should i need to use rank function?

can any one suggest some idea

thank you

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression

For Count:

If(Rank(count({<BW_UW_YEAR={$(=max(BW_UW_YEAR))}>}BW_VEH_ID)) <= 10, count({<BW_UW_YEAR={$(=max(BW_UW_YEAR))}>}BW_VEH_ID))

For Ratio:

If(Rank(count({<BW_UW_YEAR={$(=max(BW_UW_YEAR))}>}BW_VEH_ID)) <= 10,

sum({<BW_UW_YEAR={$(=Max(BW_UW_YEAR))}>}BW_CLM_INC) /sum({<BW_UW_YEAR={$(=Max(BW_UW_YEAR))}>}BW_NET_PREM))

Regards,

Jagan.

View solution in original post

15 Replies
settu_periasamy
Master III
Master III

Hi Arul,

Can you provide the sample data?

I think your can use the Dimension limit also..

arulsettu
Master III
Master III
Author

that vehicle count is not in the dimension. it was different field that is the issue.

PradeepReddy
Specialist II
Specialist II

you can use either Rank() or Dimension Limits...

PradeepReddy
Specialist II
Specialist II

can u share sample Application?

tresesco
MVP
MVP

Yes, may be using rank() in combination with aggr() or set analysis you get that. A sample qvw would be much easier to help.

arulsettu
Master III
Master III
Author

i will upload the sample

arulsettu
Master III
Master III
Author

please find the sample

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression

For Count:

If(Rank(count({<BW_UW_YEAR={$(=max(BW_UW_YEAR))}>}BW_VEH_ID)) <= 10, count({<BW_UW_YEAR={$(=max(BW_UW_YEAR))}>}BW_VEH_ID))

For Ratio:

If(Rank(count({<BW_UW_YEAR={$(=max(BW_UW_YEAR))}>}BW_VEH_ID)) <= 10,

sum({<BW_UW_YEAR={$(=Max(BW_UW_YEAR))}>}BW_CLM_INC) /sum({<BW_UW_YEAR={$(=Max(BW_UW_YEAR))}>}BW_NET_PREM))

Regards,

Jagan.

arulsettu
Master III
Master III
Author

Thank you very much jagan bro