Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a variable which accepts a number as a parameter and returns a number.
I have no problem including this in the chart by passing a value from another from another column.
$(vCalcFinalScore(Score))
but it doesn't work when I call the variable like this:
$(vCalcFinalScore(TextBetween(Score,'|','|',2)))
I am getting an error "TextBetween takes 3-4 parameters"
The column Score is an other expression on the same chart.
Not sure what I am missing here.
When the variable first encounters with a comma, it terminates as the end of the first argument and that is why you can't pass any value/expression that has comma in between in that way. Alternatively you could have one more variable to hold the expression and pass it in the variable as argument. PFA
How do you define the variable?
The variable vCalcFinalScore has some validations to return a single digit number. A simplified definition looks like this:
if ($1>99 and $1<999, if (substringcount($1,'4')>substringcount($1,'3'),4,3),99)
So, you are supposed to pass a number as argument to the variable. And do you expect 'TextBetween(Score,'|','|',2)' to return a number? I guess a sample qvw would be easier to investigate.
The expression "Final Value-fails" doesn't return anything when I use textbetween function output and as parameter. The "Final Value-works" does return right value when an expression value is passed as parameter.
When the variable first encounters with a comma, it terminates as the end of the first argument and that is why you can't pass any value/expression that has comma in between in that way. Alternatively you could have one more variable to hold the expression and pass it in the variable as argument. PFA
Sorry that I can't open your QVW. I am using v12 personal edition.
Can you please paste both the expression and variables you have included?
vText =TextBetween('|123|22|334|3|','|','|',1)
$(vCalcFinalScore(vText))
This works! Thanks