Level Aware aggregate calculations

Hi please help me how can I use Level Aware calculation for below expression?

I want to fix the below expression, Want to compute the granularity based on this expression.

In tableau this expression is created using fixed lod like this
{ FIXED : SUM(IF [Application1] <= [Date Selection] AND [Application1] >= DATETRUNC(‘month’,[Date Selection]) THEN ([Total Cost with CSP]) END) }

with reference to this how can I convert this calculation for AWS qucksight?

ifelse(Application <= ${Dateselection2} AND Application >= truncDate(‘MM’, ${Dateselection2}),
{Total Cost with CSP},0)

Hello @Mayur1 !

I’m not sure I understand where you are running into trouble here. Is this calculated field throwing an error or not returning the expected values?:

ifelse(
Application <= ${Dateselection2} AND 
Application >= truncDate(‘MM’, ${Dateselection2}),
{Total Cost with CSP},
0)

If you want to use that with a LAC function you could try wrapping it in something like a sumOver and partition by a dimension in your dataset.

1 Like

Hello @Mayur1 !

Are you able to share what results you were getting from the calculated field or were you able to try using the LAC function?

Hi @Mayur1. Did this solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the QuickSight Community!