Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Resolve formula in script

Hi all...

I have a XLS with Formula, like this:

Code Formula
A A1 + A2
B B1 + B2
Z A + B

How do I resolve Z?
After the load-script I want to have a table with the following result:

Code Formula
A A1 + A2
B B1 + B2
Z A1 + A2 + B1 + B2

Maybe someone could help me?

Thanks a lot
Ivo

1 Solution

Accepted Solutions
Not applicable
Author

Hi Milda.

Yes this works fine! Smile

Now I would create me a loop, because I have an undefined number (max.5) of nested levels like this:

code, formula
$A, 'A1, A2'
$B, 'B1, B2'
$Z, '$A, $B'
$ZZ, '$Z, C1, C2'


Thank you very much!
Nice weekend.

Best Regards.

View solution in original post

3 Replies
Not applicable
Author

Hi,

try to use MapSubstring function. Here is an example how to write a load script:

map_table:

MAPPING LOAD

Not applicable
Author

map_table:



MAPPING

LOAD





code

,

formula

FROM ....

xls;







Formulas:

load

code,

IF

(code='Z',mapsubstring('map_table',formula),formula) as formul

FROM ..

.xls;



I hope this will help you.

Regards,

Milda



Not applicable
Author

Hi Milda.

Yes this works fine! Smile

Now I would create me a loop, because I have an undefined number (max.5) of nested levels like this:

code, formula
$A, 'A1, A2'
$B, 'B1, B2'
$Z, '$A, $B'
$ZZ, '$Z, C1, C2'


Thank you very much!
Nice weekend.

Best Regards.