Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. 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