Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

index

i have filed

Sal

100

200

300

here i want to find the of 300 sal in sal table

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Lookup() may be helpful, though it's (still) a script-only function.

Like in:

RawData:

LOAD RowNo() AS RNo, Sal INLINE [

Sal

100

200

300

];

LET vIndex = Lookup('RNo', 'Sal', 300);

If you want to use this value in the User Interface, can you provide us a few more details about what you are up to?

Peter

View solution in original post

6 Replies
Not applicable
Author

HI,

here i want to find the of 300 sal in sal table   -  what it means

Not applicable
Author

means index location of 300

i used index(sal,300) butt return 0 when i used index(sal,100) return 1 ?

its_anandrjs
Champion III
Champion III

It will return 1 every time with not index value because it is

Check with this if you load you can find 4 and 7 because it is this locations

LOAD Sal,

Index(Sal,200) as Index200,

Index(Sal,300) as Index300;

LOAD * Inline

[

Sal

100200300

];

Regards

Anand

rubenmarin

Hi hammad, maybe FieldIndex('Sal', 300), QV only stores different values so for a table like:

Sal

100 -->Index 1

200 -->Index 2

100 -->Index 1 (is a value previously loaded)

300 -->Index 3

The Index() funtion you are using to return the position where a substring starts in a string, ie:

Index('ABC', 'B') --> Returns '2'

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Lookup() may be helpful, though it's (still) a script-only function.

Like in:

RawData:

LOAD RowNo() AS RNo, Sal INLINE [

Sal

100

200

300

];

LET vIndex = Lookup('RNo', 'Sal', 300);

If you want to use this value in the User Interface, can you provide us a few more details about what you are up to?

Peter

Not applicable
Author

i think

it wont work

because u have to use only strings in index function .

ex:

index('apple','e')  it returns 5