Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

anonymous1
New 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?

2 Replies
MVP
MVP

Re: if statement expression syntax

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

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

Frank_Hartmann
Honored Contributor II

Re: if statement expression syntax

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