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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with Set Expression

I have a field called StatusMonth.  Values are strings of the form 'YYYY-MM mmm' (e.g. '2014-01 Jan').

I also have a variable that I set called vCurrent13Month and it also is a string of the form 'YYYY-MM mmm'.

I want to count the number of units where the StatusMonth is greater than or equal to vCurrent13Month but
am having difficulty with the Set expression.

Here's what I've got:

                         =Count({1 <StatusMonth={">=$(vCurrent13Month)"}> DISTINCT UnitName}

And it's just not working.  I've tried all kinds of variations and no luck.

Can anyone tell me why the above doesn't work?

Thanks,
rpb

12 Replies
Not applicable
Author

Alex,

Trying to implement this in script and keep getting "Syntax error, missing/misplaced FROM: LOAD"

Am confused.  Here is my script:

CONNECT32 TO [MS Access Databases;DBQ=C:\Users\DickByrne\Documents\ITO Customer Service\BU Metrics\Dashboard\GSS Insight\KPI Dashboard\Global KPI Data.accdb];
//-------- Start Multiple Select Statements ------
LOAD
StatusMonth,
MakeDate(Left(StatusMonth, 4), Mid(StatusMonth, 6, 2)) As Period,
PriorMonth,
MakeDate(Left(PriorMonth, 4), Mid(PriorMonth, 6, 2)) As PriorPeriod,
CurrentYear,
PriorYear,
RollAvgStart,
MakeDate(Left(RollAvgStart, 4), Mid(RollAvgStart, 6, 2)) As RollAvgStartPeriod,
RollAvgEnd,
MakeDate(Left(RollAvgEnd, 4), Mid(RollAvgEnd, 6, 2)) As RollAvgEndPeriod,
[13MonthStart],
MakeDate(Left([13MonthStart], 4), Mid([13MonthStart], 6, 2)) As 13MonthStartPeriod;
SQL SELECT *
FROM StatusMonths;

SQL SELECT *
FROM Units;

SQL SELECT *
FROM `KPI_Data`;

SQL SELECT *
FROM `Sev1_Data`;
//-------- End Multiple Select Statements ------

Not applicable
Author

Richard,

Putting brackets around your 13MonthStartPeriod should take care of it;

[13MonthStartPeriod]

The error "Syntax error, missing/misplaced FROM: LOAD" typically means you're missing a comma, semicolon or an error that relates to what you've received (sometimes it's from a space in the field name too). In this instance it's the leading integer.

Not applicable
Author

Many thanks, Alex! That did it.