Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
aheavy95
Creator
Creator

Varaiable as field in aggr

Hi
In this dynamic report (ad hoc report) there is a constant dimension - StoreID, and the other 2 dynamically change according to the user's selections in the upper filters (same with the measure)

aheavy95_2-1696517491385.png

 

 

This is my measure: 



What I'm trying to achieve is: dynamically changing the fields inside the aggr: Hour,Year based on the user's selections.

I assume it should be done using a variable but it hasn't worked for me.

I've created a varaible (Float1.Name is the inline field ) : aheavy95_3-1696517867288.png

and used it in the measure instead of the "Year" field but the measure showed nulls only.

if( Sum(NetSales) >= Max( total <StoreID> Aggr( Sum(NetSales),StoreID, Hour,Year) )-1,
     Max( total <StoreID> Aggr( Sum(NetSales),StoreID, Hour,$(vDynFloat1)) ),
     Null()
)

What am I doing wrong? (open to other ways as well)

Thanks 

 

 

Labels (5)
1 Solution

Accepted Solutions
vincent_ardiet_
Specialist
Specialist

I would say that you need to add a "=" in your variable definition, or, you can add it in the expression:
Max( total <StoreID> Aggr( Sum(NetSales),StoreID, Hour,$(=vDynFloat1)) )

View solution in original post

2 Replies
vincent_ardiet_
Specialist
Specialist

I would say that you need to add a "=" in your variable definition, or, you can add it in the expression:
Max( total <StoreID> Aggr( Sum(NetSales),StoreID, Hour,$(=vDynFloat1)) )

aheavy95
Creator
Creator
Author

That helped! thanks a lot