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

Use of Min in calculated dimension

Can anyone tell me why I can't use Min(adate) in a calculated dimension?

='Contract End from ' &  ' ; Contract Types ' & GetFieldSelections([Contract Type])

works fine,

but

='Contract End from ' & min([Contract End]) &  ' ; Contract Types ' & GetFieldSelections([Contract Type])

Does not.

Regards,

M

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

I didn't hear it but i think you are going for a min date across all records in the current selections, not a dimensional mininmum. if that is the case this works in your sample as well:

=date(Min( total EndDate)) 

View solution in original post

12 Replies
Anonymous
Not applicable

Does it give you an error or the result is not the expected?

Try replacing min([Contract End])   by:

min(Aggr([Contract End], [Contract End]))

Marc.

JonnyPoole
Former Employee
Former Employee

Do you want it to be the min out of every date in the chart ,  in the current selection, in the date model ? 

See below for min date in a year and min date in whole chart .  expressions are in the column header:

Capture.PNG.png

martynlloyd
Partner - Creator III
Partner - Creator III
Author

Hi, the main problem is that I get the error

// Error in calculated dimension

Thanks,

M.

JonnyPoole
Former Employee
Former Employee

Can you share a sample (qvw)  ? 

martynlloyd
Partner - Creator III
Partner - Creator III
Author

Example attached

JonnyPoole
Former Employee
Former Employee

Is this what you need ?

Calculated dimension formula:    =date(aggr(Min(EndDate),Customer))

Capture.PNG.png

abeyphilip
Creator II
Creator II

Hi,

Can you try it using a variable?

Please check attached qvw.

Regards,

Abey

martynlloyd
Partner - Creator III
Partner - Creator III
Author

Interesting idea, it certainly solves the syntax error, but no use because the dim has to be dynamic - based on the selection.

Regards,

M.

abeyphilip
Creator II
Creator II

But where have you set the variable. I hope not in the load script.

Because if it is from the - "Settings -> Variables Overview", those variables are dynamic and it will change as per your selection of the field used in variable definition.

Regards,

Abey