Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
zagzebski
Creator
Creator

SET function used in where clause

I am trying to set a variable: 

SET JANRETENSION = B201;

(I tried it will as SET JANRETENSION = 'B201' as well and it didn't work either)

But when I use it in my where clause it is not recognized.

Here is the script followed by the error message:

 

ProductionByDeptByCust:

Load
[Dept] as [Temp Dept],
sum([Commission]) as [Temp Commission Dept]
Resident Production
Where
ProdGLMonthOrig <= $(JANRETENSION)

and

ProdGLMonthOrig >= $(JANRETENSION)

and

Dept<>'4'

Group By [Dept]
Order by Dept ASC;

Error MESSAGE I am getting:

Field not found - <B201>

ProductionByDeptByCust:

Load

[Dept] as [Temp Dept],

sum([Commission]) as [Temp Commission Dept]

Resident Production

Where

ProdGLMonthOrig <= B201

and

ProdGLMonthOrig >= B201

and

Dept<>'4'

Group By [Dept]

Order by Dept ASC

1 Solution

Accepted Solutions
Anonymous
Not applicable

You have to use it this with single quotes:

ProdGLMonthOrig <= '$(JANRETENSION)'

and

ProdGLMonthOrig >=' $(JANRETENSION)'

View solution in original post

1 Reply
Anonymous
Not applicable

You have to use it this with single quotes:

ProdGLMonthOrig <= '$(JANRETENSION)'

and

ProdGLMonthOrig >=' $(JANRETENSION)'