Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
zagzebski
Contributor

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

Tags (1)
1 Solution

Accepted Solutions
mov
Esteemed Contributor III

Re: SET function used in where clause

You have to use it this with single quotes:

ProdGLMonthOrig <= '$(JANRETENSION)'

and

ProdGLMonthOrig >=' $(JANRETENSION)'

1 Reply
mov
Esteemed Contributor III

Re: SET function used in where clause

You have to use it this with single quotes:

ProdGLMonthOrig <= '$(JANRETENSION)'

and

ProdGLMonthOrig >=' $(JANRETENSION)'

Community Browser