# Problem with a LAC calc

**URL:** <https://community.amazonquick.com/t/problem-with-a-lac-calc/32684>\
**Category:** Q&A\
**Tags:** level-aware, filters, calculations, Business-Intelligence-Engineer, quick-sight\
**Created:** [July 16, 2024, 9:52pm UTC](https://community.amazonquick.com/t/problem-with-a-lac-calc/32684 "2024-07-16T21:52:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gprice](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@gprice](https://community.amazonquick.com/u/gprice)\
**Post date:** [July 16, 2024, 9:52pm UTC](https://community.amazonquick.com/t/problem-with-a-lac-calc/32684/1 "2024-07-16T21:52:13Z")

</div>

I’m trying to get some LAC calculations to work but I’m hitting a wall. I have a viz that has a date-range filter and displays metrics of employees. One metric shows the % of Total Sales for each employee. I also have an Action Filter that allows users to filter on a specific employee to show the Sales details for that employee in another viz.

The denominator for the % Sales calc is TotNet :: sumover(Sum({Net Sales}),). But when the Action Filter is activated TotNet changes to the total for that employee. I’ve tried PRE\_FILTER but no joy. What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![prantika\_sinha](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/prantika_sinha/32/21878_2.png) [@prantika\_sinha](https://community.amazonquick.com/u/prantika_sinha)\
**Post date:** [July 17, 2024, 5:42am UTC](https://community.amazonquick.com/t/problem-with-a-lac-calc/32684/2 "2024-07-17T05:42:29Z")

</div>

Hi @gprice ,

Welcome to the Quick Sight Community!

Can you try sumOver({Net Sales},,PRE\_FILTER) to calculate the denom?

Thanks,  
Prantika

---

<div class="post-metadata">

**Author:** ![gprice](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@gprice](https://community.amazonquick.com/u/gprice)\
**Post date:** [July 17, 2024, 11:09am UTC](https://community.amazonquick.com/t/problem-with-a-lac-calc/32684/3 "2024-07-17T11:09:18Z")

</div>

As I mentioned in the OP I tried PRE\_FILTER (and out of desperation PRE\_AGG) but neither worked. But thanks for trying.

---

<div class="post-metadata">

**Author:** ![prantika\_sinha](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/prantika_sinha/32/21878_2.png) [@prantika\_sinha](https://community.amazonquick.com/u/prantika_sinha)\
**Post date:** [July 17, 2024, 11:59am UTC](https://community.amazonquick.com/t/problem-with-a-lac-calc/32684/4 "2024-07-17T11:59:04Z")

</div>

I have tried out the same solution in this sample dashboard. You can check this out.  
[32684 sample solution](https://community.amazonquick.com#Arena-dashboardId=177cc76b-d902-4989-9644-0e75ec798933&authorId=CU-7605)

Also, please share sample dashboard in Arena with more details to help you debug the issue.

---

<div class="post-metadata">

**Author:** ![gprice](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@gprice](https://community.amazonquick.com/u/gprice)\
**Post date:** [July 17, 2024, 1:43pm UTC](https://community.amazonquick.com/t/problem-with-a-lac-calc/32684/5 "2024-07-17T13:43:37Z")

</div>

Good morning (for me at least) Prantika. The analysis I’m working on is client data so I can’t upload it without first having to mock-up a suitable dataset. That said, I tried PRE\_FILTER again this morning and it behaved completely differently than it did yesterday. Closer but still not correct. The analysis has 2 Filter Controls overall: Transaction Date Range and Store. Under those, there is the Action Filter for Employee. When I use the sumover(PRE\_FILTER) it ignores all the filters and I get a total for all dates and stores. I just want the total for the specified date range and selected Store, of course. I’ve tried using a partitioned sumover: sumover(SUM(net\_sales),[{employee}]) but that doesn’t work either. Any advice? I feel we’re close.

---

<div class="post-metadata">

**Author:** ![prantika\_sinha](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/prantika_sinha/32/21878_2.png) [@prantika\_sinha](https://community.amazonquick.com/u/prantika_sinha)\
**Post date:** [July 17, 2024, 5:01pm UTC](https://community.amazonquick.com/t/problem-with-a-lac-calc/32684/7 "2024-07-17T17:01:30Z")

</div>

Yes, you are on the right path to partition by the fields.

Can you check out [a similar solution](https://community.amazonquick.com/t/sumover-and-representativity/31434) I shared earlier? I recall, the use case was close to what you mention here.

Or if you can mock up some data to try out, I can give that a try. Based on what is your data granularity, the aggregations will also vary.

---

<div class="post-metadata">

**Author:** ![Brett](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/brett/32/36494_2.png) [@Brett](https://community.amazonquick.com/u/Brett)\
**Post date:** [July 30, 2024, 3:06pm UTC](https://community.amazonquick.com/t/problem-with-a-lac-calc/32684/8 "2024-07-30T15:06:28Z")

</div>

Hi @gprice,  
It’s been a while since we last heard from you, are you still facing issues or were you able to find a work around for your case?

If we do not hear back within 3 business days, I’ll go ahead and close out.

Thank you!

---

<div class="post-metadata">

**Author:** ![Brett](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/brett/32/36494_2.png) [@Brett](https://community.amazonquick.com/u/Brett)\
**Post date:** [August 5, 2024, 2:41pm UTC](https://community.amazonquick.com/t/problem-with-a-lac-calc/32684/9 "2024-08-05T14:41:54Z")

</div>

Hi @gprice,  
Since we have not heard back, I’ll go ahead and mark as solved. However, if you have any remaining questions, feel free to create a new topic in the community and link this discussion for relevant information.

Thank you!
