Skip to main content
Solved

Select newest file, sort parameter

  • Jun 17, 2019 9:58 AM UTC
  • 1 reply
  • 129 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.
View original

1 reply

mohansx
Forum|alt.badge.img+5
  • Former AIMMSian
  • Answer
  • Jul 2, 2019 2:47 AM UTC
@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