Discussion Board for collaboration related to Creating Analytics for QlikView.
I have a dimension MATERIAL ,i need values of that filed in two rows on axis what i mean is
suppose Ammonium chloride is it possible to change it in to Ammonium
chloride(breaking all the labels in to two rows )
please find the attachment
Go to Solution.
u can give a try.
because same i got the issue before. i used below code .its wrks fine
=left(Field, findoneof(Field, ' ', ceil(substringcount(Field, ' ')/2))) & chr(13) & chr(10) & right(Field, len(Field) - findoneof(Field, ' ', ceil(substringcount(Field, ' ')/2)))
May be this:
SubField(MATERIAL, ' ', 1) & Chr(10) & SubField(MATERIAL, ' ', 2)
where should i need to write this because MATERIAL is my dimension
so should i write it in ADD CALCULATED DIMENSION
Yes, instead of using MATERIAL, use the above expression.It is not going to be nice when there are more then 2 words
did u try my Expression?
share ur app?
i have found this query in the community, don't remember the link. Add your table and field name.
SUB SplitString (vField, vTable, vSegLen, vSplitField)
trim(mid($(vField), Start, Count-1)) as Split,
RowNo() as SplitId
index( mid($(vField) & ' ', Start+$(vSegLen)), ' ' )+$(vSegLen) as Count
if($(vField) = Previous($(vField))
WHILE IterNo() <= div(len($(vField)),$(vSegLen))+1
concat(Split, chr(10), SplitId) as $(vSplitField)
WHERE len(trim(Split)) > 0
GROUP BY Title
DROP TABLE Split_temp;
LOAD *, RecNo() as RecId INLINE [
This is a long title that spans a long ways
This one is even very much longer then the previous long title
A shorter title
The rain in Spain
Healthcare / Services / Consulting / Accounting
// Call parms are Field, Tablename, SplitLength, OutputSplitField
// Split the string in "Field" at the first blank after segment length of "SplitLength".
// New field "OutputSplitField" will be joined to table "Tablename"
CALL SplitString('Title', 'MyTable', 15, 'SplitTitle');