1 2 Previous Next 16 Replies Latest reply on Mar 26, 2020 2:38 PM by Deepak Rai

# Percentage of Count measure.

Guys,

I'm totally a newbie in this area. Can someone give me a hand in this situation, please?

Here is my data structure.

Each event has three time-points ( Time1,2,3).

I want to know how much difference in minuter between each stamp points. ( Time2 - Time1 and Time 3-Time2). Those numbers are presenting for how much difference between two stamp points. ( noted that number is made up).

Next, I want to count how many events which has (Time2-Time1) < 200 and events that have ( Time3-time2) <100.

After this, I need a percent number which will present Count(Time3-Time2) / Count(Time2-Time1) and show it in Row.

Here is what I've tried:

- COUNT([Time3-Time2] < 100) / COUNT([Time2-Time1] < 200)

- SUM( IF ( Time3-Time2 ) < 100 THEN 1 ELSE 0 END) / SUM( IF ( Time2-Time1 ) < 200 THEN 1 ELSE 0 END)

Both are return 100%. What am I missing?

--

To make it easy to understand. Let's say you are a doctor who treats people with COVID 19. You need to keep track of what time you give patient medicine. Each patient needs to take medicine 3 times a day. Each time is called an Event.

• ###### 1. Re: Percentage of Count measure.

try this and let me now:

{COUNT(IF  (Time2-Time1) < 200  THEN (Time2-Time1) END)}

and

this one:

{COUNT(IF ([Time3-Time2] < 100)  THEN ([Time3-Time2] )END)}

• ###### 2. Re: Percentage of Count measure.

Hi Kyle -

The formulas that you have are row level formula.  You can use the following

{COUNT(IF [TIME3 - TIME2]<100 THEN [EventID] END)} / {COUNT(IF [TIME2 - TIME1]<200 THEN [EventID] END)}

• ###### 3. Re: Percentage of Count measure.

I attached the twbx into first post.

• ###### 4. Re: Percentage of Count measure.

i see this

• ###### 5. Re: Percentage of Count measure.

Pls extract the data first

• ###### 6. Re: Percentage of Count measure.

I see. my bad. I reattached the file.

• ###### 7. Re: Percentage of Count measure.

I see. my bad. I reattached the file.

• ###### 8. Re: Percentage of Count measure.

you want this?

• ###### 9. Re: Percentage of Count measure.

Not exactly, but the number is correct. I need that % number but need to present and filter it by month. You will see it in Dimensions -> DischargeDate

• ###### 10. Re: Percentage of Count measure.

Please look in to your data, you have a range of values from Null, 0.5 and 1 , if Sum is correct as you said, then result I am getting is CORRECT too.

Thanks

Deepak

• ###### 11. Re: Percentage of Count measure.

Yep. It's true. NULL means it's not meet the condition ( timeDifferent < xxx)

For now, I'm just trying to count ID  which meets the conditions which are 1.

If you move DischargeDate into Column, you can filter by month.

• ###### 12. Re: Percentage of Count measure.

please do that in attached and close the thread as it seems that it is already answered. you just need to set up filters as per your need.

Thanks

Deepak

• ###### 13. Re: Percentage of Count measure.

Can you send me the file that you did build with the percent? I still don't know how to get the number. The one above showing two count are working.