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

Position of value in field

Is there anyway to get a textbox to return the position a value has in a field - this is specifically for use in a QV report where I am looping over said field.

E.g. This is my field and its values:

Dim
A
B
C
D
E

My report is going to loop over field 'Dim', so I'll have one report for 'A', one for 'B' etc

What I want from my text box, is firstly for it to display the field value:

=Dim

But then for it to tell me the number of the field value, according to its order.

So I would end up with

A - 1

B - 2

C - 3

D - 4

E - 5

Even better if it could tell me the total values too, so:

A - 1/5

B - 2/5

C - 3/5

D - 4.5

E - 5/5

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like:

=Dim&'-'&FieldIndex('Dim', Dim)&'/'&FieldValueCount('Dim')

View solution in original post

2 Replies
tresesco
MVP
MVP

May be like:

=Dim&'-'&FieldIndex('Dim', Dim)&'/'&FieldValueCount('Dim')

jessica_webb
Creator III
Creator III
Author

Thank you so much - that works perfectly

Do you know what order the field index works on? Is it load order, or alphabetical...

EDIT: Worked it out myself! Load order it is!