Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
arngue
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
arngue
Contributor III
Contributor III
Author

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

sunny_talwar

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
sunny_talwar

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

arngue
Contributor III
Contributor III
Author

Exactly, in a different rows!!
sunny_talwar

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.

arngue
Contributor III
Contributor III
Author

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.
dplr-rn
Partner - Master III
Partner - Master III

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

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think:

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

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

sunny_talwar

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)))
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Sunny, which version?

sunny_talwar

QV 12.1 SR2