
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LET variable, evaluate with braces
Hello Folks,
I'm trying to set a simple variable in my script. Right now, it looks like so:
LET vHasLastShift = COUNT({<IsLastShift={'*'}-{''}>}[Stop Number]);
Currently, the problem is that the script editor isn't taking too kindly to my braces, '{'. Does anyone know how to get this calculation done in my script? I need this calc in the script because it will be used as a condition for NPrinting.
Any help is greatly appreciated.
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dustin,
The way your making it only works for charts, set expression is available for charts only.
Link for chart:
Link for script count aggregation:
Count - função de script ‒ Qlik Sense
What you can do on script side is something like:
// Your first data load
Data:
Load
*
From [Whatever];
// Count table:
tmp:
Load
count([Stop Number]) as CountStopNumber
Resident Data
where len(IsLastShiftIsLastShift) > 0;
// gets the count from the previously loaded table
let vHasLastShift = peek('CountStopNumber',0,'tmp');
drop table tmp;
hope it helps;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- LET vHasLastShift = 'COUNT({<IsLastShiftIsLastShift={'*'}-{''}>}[Stop Number])';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is that my Set Restriction has single-quotes itself, and it doesn't like those as that "ends" my statement.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dustin,
The way your making it only works for charts, set expression is available for charts only.
Link for chart:
Link for script count aggregation:
Count - função de script ‒ Qlik Sense
What you can do on script side is something like:
// Your first data load
Data:
Load
*
From [Whatever];
// Count table:
tmp:
Load
count([Stop Number]) as CountStopNumber
Resident Data
where len(IsLastShiftIsLastShift) > 0;
// gets the count from the previously loaded table
let vHasLastShift = peek('CountStopNumber',0,'tmp');
drop table tmp;
hope it helps;
