Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
felcar2013
Partner - Creator III
Partner - Creator III

need dynamic index for current selected field value list

hi

how can i get a dynamic index field  that assigns the current selection a number in asc order?

like this:

load      A,

             B,

              rowno() as Index_Fix

from table.csv;

this would be the fix index. if i filter and get  a subset of rows, the index_fix will display numbers assigned to the corresponding field in the table. Assume i have Num Rows = 100. If i filter in my application, my current selection accounts for,say 23 rows. I want to create a dynamic index, which assigns to the current selection a number in numerical order: 1,2,3,4,5, ... 23.

If i do a second filter of fields and i get as current selection 4 rows, then my dynamic index shall assign to the rows 1,2,3,4

how would this be possible?

thanks for any help

Felipe

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached example for another option using one text box to display the texts.


talk is cheap, supply exceeds demand

View solution in original post

21 Replies
Gysbert_Wassenaar

Try using just rowno() as expression in your chart, or rowno(total) if your chart has multiple dimensions. Then you can use the Sort option to get the order correct.


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

Or if your new index shall be based on Index_Fix, maybe like

=rank( -only(Index_Fix) )

felcar2013
Partner - Creator III
Partner - Creator III
Author

thanks

how would that be in a text object?

felcar2013
Partner - Creator III
Partner - Creator III
Author

the requirement is the following:

from the inital table, A are comments, so every comment is different. B is the contactID and it is linked to other tables in the model which i use as filters.

I need to display all comments in a sequence in a diagram box, in form of a comment diagram. So the only thing that came to my mind, was to sort the filtered comments and to put them in text objects based on the index.

the user shall be able to scroll down the comments to see all filtered ones.

Is this possible at all?

felcar2013
Partner - Creator III
Partner - Creator III
Author

this is clear 🙂 i posted the requirement, this was only a middle step, probably there are easier ones

swuehl
MVP
MVP

Still not sure what you want to achieve, maybe

concat(FieldA, ', ', Index_Fix)

felcar2013
Partner - Creator III
Partner - Creator III
Author

thanks for this

i want to get the filtered comments displayed, one by one, in text boxes, as indicated in the requirement.

the index shall help to sort the comments, but maybe there is another easier way to reach the same final goal.

swuehl
MVP
MVP

I personally would not use text boxes, but if that's your requirement.

Create as many text boxes as possibly needed.

In each textbox, create an expression like

=only({<Index_Fix = {1} >} FieldA)

=only({<Index_Fix = {2} >} FieldA)

=only({<Index_Fix = {3} >} FieldA)

=only({<Index_Fix = {4} >} FieldA)

...

and maybe use a show condition for your text box to hide text boxes not needed.

edit:

Or maybe this is a better idea:

If your number of lines / text boxes is limited to say 10 after selection, create 10 text boxes with an expression like

=FirstSortedValue( FieldA, Index_Fix, 1)

=FirstSortedValue( FieldA, Index_Fix, 2)

=FirstSortedValue( FieldA, Index_Fix, 3)

=FirstSortedValue( FieldA, Index_Fix, 4)

...

felcar2013
Partner - Creator III
Partner - Creator III
Author

i attached a doc

i filtered already and want to display one by one the text content in a different text box. Text boxes shall vary according to the selection

what would recommend as an easiest way to display the text list? (the comment diagramm is because they want this to look nice)

thanks