Skip to main content
Solved

Select newest file, sort parameter

  • June 17, 2019
  • 1 reply
  • 73 views

Hi,

I have an integer set, a parameter with filenames, and a parameters with Aimms'standard date/time.
How do I select the newest file, or how to sort a parameter and select the first, or how to select the smallest, largest?

Thanks!

Best answer by mohansx

@wiet

You can use the argmax and argmin functions to find the index which has the smallest / largest value.

So, Filename(argmax(i, dateparameter)) will give you the newest file / filename corresponding to the index which has the greatest (most recent date) value in the date/time parameter.

1 reply

mohansx
Forum|alt.badge.img+5
  • Former AIMMSian
  • 223 replies
  • Answer
  • July 2, 2019
@wiet

You can use the argmax and argmin functions to find the index which has the smallest / largest value.

So, Filename(argmax(i, dateparameter)) will give you the newest file / filename corresponding to the index which has the greatest (most recent date) value in the date/time parameter.


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator