Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
prashanth1712
Contributor III
Contributor III

Percentage count ?

TableA:

TripNum   Traveler  Type

128            A          Direct

123            B          Indirect

198            C          Direct

190            D          Online

908            E          Indirect

TableB:

TripNum   Traveler  Type

128             A         Rental

153             B         Rental

190             D        -

164             E         Rental

Now I used the following expression to the TripNum % :

count({<TripNum ={"=count(distinct Type>0"}>} distinct  TripNum)

/Count({<Type=>} distinct (TripNum))

I am getting the TripNum %, but the problem here is when I select Rental in Type filter,

it is calculating for all tripnum count, instead I want it to consider only count from Table2.

Without any selections applied, it is working fine.

how can get % for only rental : actual o/p: 3/9= 33.33

expected %= 3/4=75%,

2 Replies
Anil_Babu_Samineni

Can you please post application

R

count({<TripNum ={"=count(distinct Type>0"}>} distinct TripNum)

/Count({<Type=>} TOTAL TripNum)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Are these two tables getting concatenated together in your data model? Can you elaborate the reason for seeing the information from only table 2 when Rental is selected?