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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
wallerjc
Partner - Contributor III
Partner - Contributor III

Set Analysis in variable

Hi

I have a set analysis expression:

    time( fractile( {<[Year]={$(=Max([Year]))},  [ColA]={`n/a`}>} [ColB], 0.5), `hh:mm`)


This works when I'm using it in a table and returns as expected

When I try to place this in my Load script, inside of a variable:


set vTest = 'time( fractile( {<[Year]={$(=Max([Year]))},  [ColA]={`n/a`}>} [ColB], 0.5), `hh:mm`)';

n.b. I have replaced ' with ` to keep the string playing nice.


Replacing my original expression in my table now returns NULL, not the value as expected.


I have found it is this part of the expression ($(=Max([Year]))) which isn't happy living inside of the variable, could anyone help or advise why this would be?


Thanks

James.

1 Solution

Accepted Solutions
tomasz_tru
Specialist
Specialist

Engine sees $ and tries to calculate. Try to wrap your extension into replace function - examples: Stop Dollar Sign Expansion in the script (Escape Character ??? )

View solution in original post

2 Replies
tomasz_tru
Specialist
Specialist

Engine sees $ and tries to calculate. Try to wrap your extension into replace function - examples: Stop Dollar Sign Expansion in the script (Escape Character ??? )

wallerjc
Partner - Contributor III
Partner - Contributor III
Author

Oh dear, I did this as a dirty workaround and it's gonna be a pig!  Thanks anyway I'll add another workaround for this replace nonsense and hopefully I'll be there.

Cheers for the quick response, enjoy your day.