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: 
googel84
Partner - Creator III
Partner - Creator III

Interpret field values as formulas

Hi there, is there a way to interpret the content of a field as a formula and execute it? I have a table whose third field contains formula expressions and I want to execute instead of simply showing them.

Look at the picture below.

Immagine.png

I tried with $ expansion and fieldvalue but it does not work.

1 Solution

Accepted Solutions
googel84
Partner - Creator III
Partner - Creator III
Author

I found the solution (it's pretty similar to the one suggested in the post mentioned by Piet Hein van del Stigchel.

First of all, formulas must not start with "=" symbol; then, the pivot table expression can be set like this:

pick([RTA_FORMULE.RTA measure index],

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',1)),

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',2)),

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',3)),

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',4)),

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',5)),

...

)

Thanks

View solution in original post

5 Replies
stigchel
Partner - Master
Partner - Master

$ expansion in an expression is only evaluated once for the whole chart, so this will only work when there is 1 valid formula. Take a look at the following thread, maybe it can help you.

Using formulas from excel in the straight table

googel84
Partner - Creator III
Partner - Creator III
Author

I found the solution (it's pretty similar to the one suggested in the post mentioned by Piet Hein van del Stigchel.

First of all, formulas must not start with "=" symbol; then, the pivot table expression can be set like this:

pick([RTA_FORMULE.RTA measure index],

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',1)),

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',2)),

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',3)),

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',4)),

$(=fieldvalue('RTA_FORMULE.RTA measure formula 2',5)),

...

)

Thanks

sakamsureshbabu
Creator
Creator

$ expansion in an expression is only evaluated once for the whole chart, so this will only work when there is 1 valid formula.

ivan_will
Partner - Creator II
Partner - Creator II

Hi Alberto, Could you please explain your solution in details, I have just tested it and seems I can not make it working!

I have similar fields in my db as your  [RTA_FORMULE.RTA measure index]  and [RTA_FORMULE.RTA measure formula 2]  where:

[RTA_FORMULE.RTA measure index]  is the row no 

[RTA_FORMULE.RTA measure formula 2] is the formula

Thanks in advance! If possible could you upload a simple example! Tnx

Anonymous
Not applicable

Ivan, did you ever find an example file using this? Thanks in advance.