INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Request: Podcast Played Percentage  (Read 2527 times)

RedJ

  • Galactic Citizen
  • ****
  • Posts: 297
Request: Podcast Played Percentage
« on: May 15, 2013, 11:54:20 am »

One thing that would greatly enhance MC's podcast handling would be to add a way to display the percentage listened for a given podcast. 

Looking at a long list of podcasts, it's hard to tell which I've listened to, which I'm in the middle of, and which haven't been started.  I've turned on the bookmark column which at least gives a gross, if inelegant, way to see if a podcast has been started and how far, relative to other completed podcasts in the list, I've gotten.  However, it's hard to tell if the podcast was listened to completely without knowing the bookmark number at the end of the podcast.

Can MC add a field that will calculate a percentage played based on the bookmark relative to the total podcast length?  A bar graphic would be nice, but not necessary to give the necessary information at a glance.
Logged

pahunt

  • World Citizen
  • ***
  • Posts: 236
Re: Request: Podcast Played Percentage
« Reply #1 on: May 15, 2013, 03:42:19 pm »

I've created a calculated column that shows me the % of a video watched, I assume it will work equally well for podcasts

Math(Math([Bookmark] / Math([Duration, 0] * 1000)) * 100)

I will point out that it's not perfect as sometimes it produces a value very slightly over 100% and I'm sure there's a way to resolve that but it works well enough for me.

RedJ

  • Galactic Citizen
  • ****
  • Posts: 297
Re: Request: Podcast Played Percentage
« Reply #2 on: May 15, 2013, 04:02:53 pm »

Thanks!  Is there a way to limit or format the result to the nearest whole number?  I'm getting a lot of decimal places.
Logged

pahunt

  • World Citizen
  • ***
  • Posts: 236
Re: Request: Podcast Played Percentage
« Reply #3 on: May 15, 2013, 04:07:29 pm »

Use this expression:

FormatNumber(Math(Math([Bookmark] / Math([Duration, 0] * 1000)) * 100), 2)

The 2 at the end specifies the number of decimal places so replace with whatever you want

RedJ

  • Galactic Citizen
  • ****
  • Posts: 297
Re: Request: Podcast Played Percentage
« Reply #4 on: May 15, 2013, 04:11:32 pm »

Thanks again.  Works great now. 
Logged

RedJ

  • Galactic Citizen
  • ****
  • Posts: 297
Re: Request: Podcast Played Percentage
« Reply #5 on: August 16, 2013, 12:58:34 pm »

I just wanted to update this topic for MC users who, like me, may be more enthusiast than expert at things like calculated fields.

I recommend adding the &DataType=[number] modifier to the end of the expression.  Otherwise, MC will see the field as a string and you will not be able to search based on mathematical operators such as [% Played]=<85 (only show Podcasts less than 85% played), etc.

Here's the expression I ended up with for my calculated field "% Played":
Code: [Select]
FormatNumber(Math(Math([Bookmark] / Math([Duration, 0] * 1000)) * 100))&DataType=[number]
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Request: Podcast Played Percentage
« Reply #6 on: August 16, 2013, 03:06:12 pm »

Ouch, that's a lot of math calls.  Use a single call, passing an entire math expression with parens:

   FormatNumber(Math(([Bookmark] / ([Duration, 0] * 1000)) * 100), 2)

By the way, this is the same value, in whole numbers:

   listitem(watched(3),0,%)
Logged
The opinions I express represent my own folly.

RedJ

  • Galactic Citizen
  • ****
  • Posts: 297
Re: Request: Podcast Played Percentage
« Reply #7 on: August 16, 2013, 03:42:19 pm »

Thanks MrC for helping to optimize the expression.  One final tweak, to your example...

I change the 2 at the end of the expression to 0 because I don't want any decimals in my percentage:
FormatNumber(Math(([Bookmark] / ([Duration, 0] * 1000)) * 100), 0)&DataType=[number]

I know you also gave this example:
Quote
By the way, this is the same value, in whole numbers:

   listitem(watched(3),0,%)
This would be good for no decimals, except it doesn't work quite right, at least for me.  When I created a calculated field using that equation, about half of the results come back as dates instead of percentages (i.e. "Aug 15")
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Request: Podcast Played Percentage
« Reply #8 on: August 16, 2013, 04:20:40 pm »

Yes, you'll have to check to see if a percentage value exists.  I was just showing that the number is already calculated for you.  You can use:

    ifelse(isequal(watched(3), %, 7), listitem(watched(3),0,%))

If a percent exists in Watched(3), output that percent number.

In MC19, you can skip the formatnumber by using Math's new round() function:

   Math(round(([Bookmark] / ([Duration, 0] * 1000)) * 100))

but in < MC19 to round and truncate you have to use:

   Math(v=(([Bookmark] / ([Duration, 0] * 1000) * 100) + .5);v-(v%1))
Logged
The opinions I express represent my own folly.

RedJ

  • Galactic Citizen
  • ****
  • Posts: 297
Re: Request: Podcast Played Percentage
« Reply #9 on: August 16, 2013, 04:48:07 pm »

Wow, that's a lot of ways to skin this cat!  I think I'll update to the round() version just in case the old way is deprecated in the future.

Thanks for all the good information!
Logged
Pages: [1]   Go Up