Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Evaluating expression out of a database string

Hi everyone

I have the following expression

=$(=2*2*3)

This returns, as expected, 12.

Now if I use

=$(='2*2*3')

it also returns 12,

In my dashboard I need to load this mathematical operation out of a database. Therefore I made a field named Formula in a database table. If I make the expression this way

=$(='Formula')

it returns, as exprected, the text "2*2*3". But I want to have it calculated.

Therefore I tried =$($(='Formula')) or =$(=$(='Formula')) but neither of them seems to work. Is there a way to solve this problem and to calculate the content of the Formula field?

Thanks in advance for any help.

7 Replies
tresesco
MVP
MVP

Try:

=$(=Formula)

Not applicable
Author

This doesn't resolve the expression at all.

Anonymous
Not applicable
Author

Create the expression as a variable and call that variable in the expression

LET Var = '=$(='Formula')'

or

LET Var =$(='Formula')


and in the expression window use $(Var)

tresesco
MVP
MVP

How are the values exactly in the field?

like: 2*2*3 , "2*2*3" or with single quotes?

Not applicable
Author

In this way 2*2*3

Not applicable
Author

unfortunately none of the both variants work. In the upper example LET Var = '=$(='Formula')' it is interpreted as a string, and the lower it has the same behaviour as in my code.

jerrysvensson
Partner - Specialist II
Partner - Specialist II

I don't know if I fully understood, but this works.

test:
LOAD * Inline [
Formula
2*2*3
];

Then add this expression to a textbox

=sum($(=Formula))

This will return 12