Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Simon4
Creator
Creator

Dynamic variable in set analysis

Hi all,

 

I have a set analysis with a dynamic variable i cannot get working.

variable:  VARIABLEDATE =

AGGR(max(if(LOADDATE_POC<vPeildatum,LOADDATE_POC)),Mainproject_id)

 

When I use it in this formula:

AGGR(only({<LOADDATE_POC = {'($(VARIABLEDATE))'},HasFinancialDoneDate = {'0'}>} Project_number),Mainproject_id)

I get only NULL.

 

When I set another variable:

test = 19-01-2023

 

and use it in the formula the same:

AGGR(only({<LOADDATE_POC = {'($(test))'},HasFinancialDoneDate = {'0'}>} Project_number),Mainproject_id)

I do not get null values.

 

has this something to do with the fact that the variable is dynamically changing?

 

P.S. The variable differs per Mainproject_id

 

Labels (1)
4 Replies
Vegar
MVP
MVP

I notice you have a vPeildatum in your variable. Is that a variable or a field name? If its a variable then you should probably try to dollar expand it : $(vPeildatum).

Simon4
Creator
Creator
Author

vPeildatum = toady() 

OR

the date selected in a date selector.

 

when I use $(VARIABLEDATE) as a measure it works, so I don't think the problem lays whitin the variable

Vegar
MVP
MVP

It is hard do know whats wrong without sitting down and examining the applikcation and variables, but try this expression.

=AGGR(only({<LOADDATE_POC = {"=$(VARIABLEDATE)"},HasFinancialDoneDate = {'0'}>} Project_number),Mainproject_id)

...and the VARIABLEDATE should probably look like this:  AGGR(max(if(LOADDATE_POC<$(vPeildatum),LOADDATE_POC)),Mainproject_id)

vinieme12
Champion III
Champion III

change variable to below

 

 VARIABLEDATE    (including the leading equal sign)

=max( TOTAL    AGGR(if(LOADDATE_POC<vPeildatum,LOADDATE_POC),Mainproject_id))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.