Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
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 (1)
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) 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
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.