Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chanty4u
MVP
MVP

RE:Ratio

Hi all,

I need to calucalte the raio between

Frmulae: Onsite Hours/Offshore Hours

Dim:Period

sample data lik dis

     

yearperiodon_0ff_flagtotal_hrstotal_amt
2011Per10Onsite    152456
2011Per10Onsite    152456
2011Per10Onsite    72216
2011Per10Offshore  152304
2011Per10Offshore  152304
2011Per10Offshore  816
2011Per10Offshore  142284

how can i achve dis?

thanks

Suresh

10 Replies
swuehl
MVP
MVP

Maybe with an expression like

=Sum({<on_0ff_flag = {'Onsite'}>} total_hrs) / Sum({<on_0ff_flag = {'Offshore'}>} total_hrs)

ajsjoshua
Specialist
Specialist

Hi try this

=SUM({$< on_off_flag={Onsite}>}total_hrs) /SUM({$< on_off_flag={Offshore}>}total_hrs)

Anonymous
Not applicable

Try as swuehl‌ suggested, then in number tab, select show in percent(%)

Chanty4u
MVP
MVP
Author

thnx swuel..

but i need  from total count of offshre and onsite.....

example:

onsite  :376/830 

in 830  total offshre +onsite...

how can i?

sunny_talwar

Try this:

=Sum({<on_0ff_flag = {'Onsite'}>} total_hrs)/Sum(total_hrs)

swuehl
MVP
MVP

Maybe just like

=Sum({<on_0ff_flag = {'Onsite'}>} total_hrs) / Sum(total_hrs)


for onsite and


=Sum({<on_0ff_flag = {'Offshore'}>} total_hrs) / Sum(total_hrs)


for offshore.

Chanty4u
MVP
MVP
Author

thanx swuehl...

this is

=Sum({<onsite_offshore_flag = {'Onsite'}>} total_hrs)/Sum({<onsite_offshore_flag = {'Offshore'}>} total_hrs)&'%'

wat i used but in textbox  it is shwng 0.3191850594%

how to show  in 2digits lik  31%..?

Anonymous
Not applicable

try like this:

=num(Sum({<onsite_offshore_flag = {'Onsite'}>} total_hrs)/Sum({<onsite_offshore_flag = {'Offshore'}>} total_hrs)*100,'#.##')&'%'

sunny_talwar

‌Try this


=Num(Sum({<onsite_offshore_flag = {'Onsite'}>} total_hrs)/Sum({<onsite_offshore_flag = {'Offshore'}>} total_hrs), '##.00%')