Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
udaya_kumar
Specialist
Specialist

i need the maximum date in array in VBScript

hi,

i am using VBScript in QlikView, i have one array, which contains the list of dates, but i want to get the maximum date from the array.

so how can i get it using VBScript?

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try like this

    

MaxDate = CDate(MyArray(0))

for i = 1 to MyArray.Count -1

     if CDate(MyArray(i)) > MaxDate then

          MaxDate = CDate(MyArray(i))

next

Celambarasan

View solution in original post

4 Replies
m_woolf
Master II
Master II

Something like this?

dtmMaxDate = 0

for i = 0 to MyArray.Count -1

     if MyArray(i)> dtmMaxDate then dtmMaxDate = MyArray(i)

next

msgbox dtmMaxDate

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     How you store the dates in array?

Celambarasan

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try like this

    

MaxDate = CDate(MyArray(0))

for i = 1 to MyArray.Count -1

     if CDate(MyArray(i)) > MaxDate then

          MaxDate = CDate(MyArray(i))

next

Celambarasan

udaya_kumar
Specialist
Specialist
Author

Thanks for reply Celambarasan