Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tobiasaechter
Contributor III
Contributor III

Round function with variable

Hi,

I am trying to create a round function with a variable but only receive error messages.

Idea is to write sth like: Round(Var A, 0.1,0). The varibale is defined in the variables section of the dashboard before. 

When putting this in a chart/textbox,... I receive an error saying: Error in Expression: ')' expected

If I write the variable directly into my expression it works though.

for example: Var A = 1/2

Round(Var A, 0.1,0) -> the above mentioned error

Round(1/2,0.1,0) -> results in a value though

Can someone please help me what is going wrong here?

Thanks

Labels (3)
1 Solution

Accepted Solutions
tobiasaechter
Contributor III
Contributor III
Author

Found the problem:

Variable was created in Variable Overview, but it also included a line of commented code below the code actually in use. 

Removing the part of the variable which was commented solved it.

now it works.

Thanks though.

View solution in original post

4 Replies
Anil_Babu_Samineni

May be use $ expansion over variable like 

Round($(Var A), 0.1,0) 

or

Round($(=Var A), 0.1,0) 

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
tobiasaechter
Contributor III
Contributor III
Author

I have tried that already, but that did not help unfortunately

Anil_Babu_Samineni

Where did you created this variables? Is that "Variable Overview" / "From Script" etc. May be provide screen shot for that

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
tobiasaechter
Contributor III
Contributor III
Author

Found the problem:

Variable was created in Variable Overview, but it also included a line of commented code below the code actually in use. 

Removing the part of the variable which was commented solved it.

now it works.

Thanks though.