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: 
amien
Specialist
Specialist

help needed with CHR36

sum( {$<Year = {$(#vMaxYear)},Period = {">0 <=$(#vMaxPeriod)"}, CID = {2}>} Value )/1000

i have this formula in an inline script and now i want to have it in a variable.

The looping though the inline is no issue, but that exactly do i need to replace with CHR36 and how?

Thanks in advanced

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

LET vExpression = 'sum( {$<Year = {$' & '(#vMaxYear)},Period = {">0 <=$' & '(#vMaxPeriod)"}, CID = {2}>} Value )/1000';

Or this:

SET vExpression = sum( {$<Year = {@(#vMaxYear)},Period = {">0 <=@(#vMaxPeriod)"}, CID = {2}>} Value )/1000;

LET vExpression = replace('$(vExpression)','@','$');


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Anonymous
Not applicable

Amien

chr(36) is the $ sign.

Here is an example where I have used it to set a variable.

Let vSetMTYesterday='

  [Scheduled Arrival Date LT] = ,

  [Date] = ,

  [Day] = {"<=' & chr(36) & '(=day(today()-1))"} ,

  [Month] = ,

  [Month Year] = ,

  [MonthNum] = {"' & chr(36) & '(=num(month(today() ) ) )"} ,

  [Year] =

';

Best Regards,     Bill

Anonymous
Not applicable

Re: help needed with CHR36

Bill Markham


Amien

So you'll probably need to change your one to something like this:

sum( {$<Year = {' & chr(36) & '(#vMaxYear)},Period = {">0 <=' & chr(36) & '(#vMaxPeriod)"}, CID = {2}>} Value )/1000



Best Regards,     Bill

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

LET vExpression = 'sum( {$<Year = {$' & '(#vMaxYear)},Period = {">0 <=$' & '(#vMaxPeriod)"}, CID = {2}>} Value )/1000';

Or this:

SET vExpression = sum( {$<Year = {@(#vMaxYear)},Period = {">0 <=@(#vMaxPeriod)"}, CID = {2}>} Value )/1000;

LET vExpression = replace('$(vExpression)','@','$');


talk is cheap, supply exceeds demand
amien
Specialist
Specialist
Author

Thanks, but for some reason this is not working when i formula is in a inline script

amien
Specialist
Specialist
Author

nevermind .. my bad .. worked .. thanks