LAC Calculation Help

Hi! I want to ask if there is a way to get this result. I need to get for each ID the maximum value contained in a week of this operation: shipments / forecast.

My information is organized as this image describes. For the shipments I need the sum of the average of each of the groups, and for the forecast I just need the average for each ID
.

I almost got the number that I want, but I can not get the max value without using a LAC-W formula (maxOver) that contains the date, meaning that I’ll get the max value but with all the days of the week displayed in the table like this.

Is it possible to obtain the result that I’m looking for without the need to display all days of the week?

1 Like

Hello @cesdom, hope this message finds you well.
have you ever saw the syntax of median function?

SYNTAX

median(expression)

SYNTAX FOR LAC

median(expression, [calculation_dimension])

there is a especial syntax when you need to do a LAC, so, I think that this could help you.

tell me if it’s work, please!!

1 Like

Hi @lary_andr, thank you for your response. I’m not sure how the median would help me in this case, can you show me an example of how would you use it in this problem?

In your case maybe I try something like this:

median(shipments , [Group])

median(forecast, [ID])

I am working with something like this

maxOver(sum(avg({shipments},[{Date},{Group}]))/sum(avg({forecast},[{Date},{Group}])),[{Date},{ID}])

But in this case, the formula just lets me display the information as I showed in my post, and I’m trying to just display one row for each of the ID’s in my table, and this formula displays a row for each day of the week

Hi @cesdom,
It’s been awhile since last communication on this thread, are you still encountering the same issue or were you able to find a work around?

In regards to your visual, are you able to add a filter that just returns the one date that you’re looking to have in there?

Additionally, something else that you could consider, create a week number calc. field, then use that in your calculation as to only get one row (based on the week as opposed to each day). There’s an old post that discusses how to do this here for you to explore.

Let us know if you have any additional questions, if we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you!

Hi @Brett, I was able to find a workaround for the solution!

1 Like