Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

Array comparison in if statement not working

Hi,

I have this if statement:

ElseIf vemail.Item(j).Text <> vemail.Item(j-1).Text Then

But it keeps stopping at this part. Is there something wrong with the syntax?

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Is your loop running at least one time - you could check such things with a msgbox on one of the loop-counter, maybe with:

msgbox j 'or other counters

It could be that your counter runs out of the number of array-member.

Further is your syntax of querying vemail.Item(j).Text correct, also here is a msgbox helpful:

var = vemail.Item(j).Text

msgbox var

- Marcus

View solution in original post

4 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Is your loop running at least one time - you could check such things with a msgbox on one of the loop-counter, maybe with:

msgbox j 'or other counters

It could be that your counter runs out of the number of array-member.

Further is your syntax of querying vemail.Item(j).Text correct, also here is a msgbox helpful:

var = vemail.Item(j).Text

msgbox var

- Marcus

View solution in original post

Highlighted
Specialist
Specialist

I tried all those, it's definitely something to do with the comparison of the array, e.g. it errors when using this: vemail.Item(1).Text <> vemail.Item(0).Text

Even though vemail does have values in Item(1) and Item(0). Everything else in the loop works.

Highlighted
Specialist
Specialist

Oh but this works:

var = vemail.Item(j).Text

msgbox var

So it's strange that a comparison wouldn't work.

Highlighted
Specialist
Specialist

I think I figured it out. It seems the if statement runs out of array members.