Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load Data

What could be the possible problem when the if condition goes wrong?

I have this number 9590.101010...But Rank keep showing J.

Some numbers are correct, some are not.

Range1: 460

Range2: 13280

...

Range10: 134,509

If (value >= Range1 AND value < Range2) Then

Rank = "A"

ElseIf (value >= Range2 AND value < Range3) Then

Rank = "B"

ElseIf (value >= Range3 AND value < Range4) Then

Rank = "C"

ElseIf (value >= Range4 AND value < Range5) Then

Rank = "D"

ElseIf (value >= Range5 AND value < Range6) Then

Rank = "E"

ElseIf (value >= Range6 AND value < Range7) Then

Rank = "F"

ElseIf (value >= Range7 AND value < Range8) Then

Rank = "G"

ElseIf (value >= Range8 AND value < Range9) Then

Rank = "H"

ElseIf (value >= Range9 AND value < Range10) Then

Rank = "I"

Else  Rank = "J"

End If

1 Solution

Accepted Solutions
marcus_sommer

It could be that either value or your various Range aren't interpreted as number or in the wrong way. Where did you try to apply this kind of logic because it don't look like valid qlik-code respectively how does your real code look like?

- Marcus

View solution in original post

2 Replies
marcus_sommer

It could be that either value or your various Range aren't interpreted as number or in the wrong way. Where did you try to apply this kind of logic because it don't look like valid qlik-code respectively how does your real code look like?

- Marcus

Anonymous
Not applicable
Author

Hi Marcus,

You're right. Tried to format all the Range and it works. Thanks