Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

[Extension editor] substr of .qText

Hi com,

i want to display an articelnumber in my chart, but the problem is that i dont want to show the first 2 digits.

So it's like i have the number "01"43434343 and in only want to show 43434343. I dont know how to slice it.

Maybe someone knows if there is a substring method or something.

here a little bit of code from my js.file

html += '>';

html += "<div class='label'><img src='https://cdn./375Wx480H/"+dim.qText+"_01.jpg' class='image'>  "+dim.qText+"</div>";           

html += "<div class='bar' style='width:" + Math.round(w * (meas.qNum / vmax )) + "px;min-width:38px;'>"

html += "<div class='inner'>"+meas.qNum+"</div></div>";

html += "</div>";

and i want from the var in red only the digits after the second digit

Thanks in advance

Eric

1 Solution

Accepted Solutions
Not applicable

Re: [Extension editor] substr of .qText

since it is standard js. u can use standard js code:

+dim.qText.substring(2)+

this will give u the text of ur dimension Text after the second digit.

3 Replies
Chanty4u
Esteemed Contributor III

Re: [Extension editor] substr of .qText

did you tried this?

left(YourField, len(YourField)2)

Not applicable

Re: [Extension editor] substr of .qText

sorry but im searching for a js solution for the extension editor.

Not applicable

Re: [Extension editor] substr of .qText

since it is standard js. u can use standard js code:

+dim.qText.substring(2)+

this will give u the text of ur dimension Text after the second digit.