Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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;
The problem is that my Set Restriction has single-quotes itself, and it doesn't like those as that "ends" my statement.
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;