Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

richters
New Contributor III

Not able to multiply two variables in script

Hi all,

I have got a short question.

I am trying to multiply 2 variables:

let rundung = $(aktuellesV)*$(j);

They both should contain numbers. I am able to multiply j by j but there must be an issue with aktuellesV.

When I trace it, it looks like a number. I also tried it with the num()-function.

Does someone has got an idea how to deal with it?

Thanks in advance!

3 Replies

Re: Not able to multiply two variables in script

No idea what aktuellesV is or how it is created, but you have to make sure it is a number. Using num on a string will return a null, so that's not going to help if aktuellesV is a string. Maybe num# can help, but it's better to make sure you use a number when you create the variable.


talk is cheap, supply exceeds demand
richters
New Contributor III

Re: Not able to multiply two variables in script

aktuellesV is created with LEt aktuellesV=num(peek('hilfsverhaeltnis',$(i),'Hilfsfall'),'0,0####'); . I know that in hilfsverhaeltnis there are just numbers.

richters
New Contributor III

Re: Not able to multiply two variables in script

Well, I dont get it. isnum() returned a -1 which means, it defenitely was a number. However, I had to replace the ',' with a '.' in the number to be able to multiply that...funny thing.

Community Browser