Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
anonymous1
Contributor III
Contributor III

if statement expression syntax

hi, 

i am trying to create a line chart that uses DEPOT_ID as a dimension and i need the y-axis to count the ITEM_QTY provided the item was shipped before today and has not yet been received.  my table structure is:

DEPT_TABLE:
LOAD

DEPOT_ID,
Date(SHIP_DATE, 'MMM-YYYY') as SHIP_DATE,
Date(RECEIVED_DATE, 'MMM-YYYY') as RECEIVED_DATE ,
ITEM_TYPE_ID,
ITEM_ID,
NUM(QTY) as QTY

ive tried using this expression:

=IF([SHIP_DATE] < TODAY() and [RECEIVED_DATE]>TODAY() , sum(QTY))

but my graph is showing nothing, i think maybe my syntax is incorrect?

Labels (2)
2 Replies
tresesco
MVP
MVP

Try using sum(if(  rather than if(sum( like:

=Sum(IF([SHIP_DATE] < TODAY() and [RECEIVED_DATE]>TODAY() , QTY))

Frank_Hartmann
Master II
Master II

Maybe this:

DEPT_TABLE:
LOAD
DEPOT_ID,
Date#(SHIP_DATE, 'MMM-YYYY') as SHIP_DATE,
Date#(RECEIVED_DATE, 'MMM-YYYY') as RECEIVED_DATE ,
ITEM_TYPE_ID,
ITEM_ID,
NUM(QTY) as QTY