# Trouble With "Custom" Calculated Field Type Within Analysis

**URL:** <https://community.amazonquick.com/t/trouble-with-custom-calculated-field-type-within-analysis/4800>\
**Category:** Q&A\
**Tags:** analysis, calculations, quick-sight\
**Created:** [July 19, 2022, 5:58pm UTC](https://community.amazonquick.com/t/trouble-with-custom-calculated-field-type-within-analysis/4800 "2022-07-19T17:58:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![connoranderson](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@connoranderson](https://community.amazonquick.com/u/connoranderson)\
**Post date:** [July 20, 2022, 12:58pm UTC](https://community.amazonquick.com/t/trouble-with-custom-calculated-field-type-within-analysis/4800/3 "2022-07-20T12:58:03Z")

</div>

Hi Jesse,

No problem. So we’re looking at minutes. Specifically how many minutes our staff have spent with each patient working on 3 different task types. I have 3 pivot tables for each of the 3 task types with patients as rows. The first column is “Duration\_Minutes” which comes from our dataset. Within the pivot, this column shows for each patient the sum of their total minutes associated with that task type. Then I would like a second column that uses my ifelse statement above to say if Duration\_Minutes \>= 20, then give a 1, else give a 0.

You are right, I didn’t think I would need to use a sum within the ifelse either, but when I execute that formula without the sum I can see that many patients who have over 20 in Duration\_Minutes are not given a 1. I think this is because it’s looking at rows in our dataset to see if the patient has at least 1 record where Duration\_Minutes is \>= to 20, not looking at the summed value under Duration\_Minutes in the pivot.

To your last question, yes ultimately I’d like to count up the 1’s resulting from that ifelse to say how many patients have at least 20 minutes for the 3 task types.

---

_[View the full topic](https://community.amazonquick.com/t/trouble-with-custom-calculated-field-type-within-analysis/4800)._
