Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Why subfield chart funciton only returns first value

I have a variable like

vUnits = 'aaaa-bbbb-cccc-dddd-eeee-ffff'

 

When in a straight table (graphic chart) i put Subfield(vUnits,'-'). Why only shows first row 'aaaa'?

 

Is there anything i'm doing wrong or this can't be acomplished? I need it in a different rows.

 

Can i do any type of for each in here? because Subfield(vUnits,'-',2) returns 'bbbb'.

 

I cannot load as a subfield because its a generated value from a button in qvw.

Labels (2)
2 Solutions

Accepted Solutions
Highlighted
Contributor III
Contributor III

Thank you, for your fast reply, I'll catch another solution, bit tricky, but will also work:

I gonna just do a couple of Text chart and put Replace(vUnit,'-','\n\n') and this would emulate a table.

View solution in original post

Highlighted

Not sure why, but Rob it did not work for me using single quotes within single quotes. I had to use Chr(39) and then it worked.

=ValueList($(=Chr(39) & Replace(vUnits, '-', Chr(39)&','&Chr(39)) & Chr(39)))

View solution in original post

11 Replies
Highlighted

What exactly do you want it to do? Show all values in different rows?

Highlighted
Contributor III
Contributor III

Exactly, in a different rows!!
Highlighted

I don't think you would be able to do this on the front end of the app. AFAIK you will have to create a new field in the script and then use that.

Highlighted
Contributor III
Contributor III

Thank you, for your fast reply, I'll catch another solution, bit tricky, but will also work:

I gonna just do a couple of Text chart and put Replace(vUnit,'-','\n\n') and this would emulate a table.

View solution in original post

Highlighted
Partner
Partner

Did you try Subfield(vUnits,'-', rowno())

Highlighted
MVP & Luminary
MVP & Luminary

I think:

=ValueList($(='''' & replace('$(vUnits)','-', ''',''') & ''''))

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Highlighted

Not sure why, but Rob it did not work for me using single quotes within single quotes. I had to use Chr(39) and then it worked.

=ValueList($(=Chr(39) & Replace(vUnits, '-', Chr(39)&','&Chr(39)) & Chr(39)))

View solution in original post

Highlighted
MVP & Luminary
MVP & Luminary

Sunny, which version?

Highlighted

QV 12.1 SR2