Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Subfield with Set Analysis

I have a field called PERMISSIONS,

PERMISSIONS

TENNIS|A|B|C

TENNIS|A|B|C|D

TENNIS|A|B|C|D|E


I have 3 rows in PERMISSIONS,

I want to take only the first row, and display the last text from it


in this case, it is C from the first row and display it in the text object


How can i do that ?

It didn't worked..

10 Replies
el_aprendiz111
Specialist
Specialist

Hi,

=Concat(chr(13) & subfield(PERMISSIONS,'|',2))

conc.png

Anonymous
Not applicable
Author

Thanks for the help.

PERMISSIONS

TENNIS|A|B|C

TENNIS|A|B|C|D

TENNIS|A|B|C|D|E


I have 3 rows in PERMISSIONS,

I want to take only the first row, and display the last text from it


in this case it is C from the first row and display it in the text object


How can i do that ?

Frank_Hartmann
Master II
Master II

Maybe like that:

Load *, RowNo() as Row;

Load * INLINE [

PERMISSIONS

TENNIS|A|B|C

TENNIS|A|B|C|D

TENNIS|A|B|C|D|E

];

Textboxexpression:

=right(only({<Row={'1'}>}PERMISSIONS),1)

Peter_Cammaert
Partner - Champion III
Partner - Champion III

What do you mean by "first row"? In a listbox? And what if the sort order is reversed? Do you take the last row?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If you want the first value from the symbol table of field PERMISSIONS, you can use

=SubField(FieldValue('PERMISSIONS', 1), '|', 4)

but that will depend on the load order of the PERMISSIONS values...

its_anandrjs

Can you check with this in any text object

=Only(SubField(PERMISSIONS,'|',4))

OP01.PNG

its_anandrjs

You can try this way

LOAD *,

RowNo() AS rid;

LOAD * Inline

[

PERMISSIONS

TENNIS|A|B|C

TENNIS|A|B|C|D

TENNIS|A|B|Z|D|E

];


In text object


=Only( {<Leng={12} >} SubField(PERMISSIONS,'|',4))

Anonymous
Not applicable
Author

I should display the Last text after ' | ', it can be any line.

One row can have any no of '|', but i should display only the last text after ' | '.


And also the row values can be of any length as below

PERMISSIONS

TENNIS|Austraila|Britain|india

TENNIS|AAAA|BB|CCC|DDD

TENNIS|A|B|C|DEF|GE


How can i achieve that ?

antoniotiman
Master III
Master III

Hi,

may be this

LOAD FirstSortedValue(DISTINCT String,-Count) as MaxString;
LOAD *,SubStringCount(PERMISSIONS,'|') as Count,SubField(PERMISSIONS,'|',-1) as String Inline [
PERMISSIONS
TENNIS|Austraila|Britain|india
TENNIS|AAAA|BB|CCC|DDD
TENNIS|A|B|C|DEF|GE
]
;

Regards,

Antonio