# New to QlikView

Discussion board where members can get started with QlikView.

Contributor III

## Expression error

Hi,

I have used the below expression but it is not working.

Logic:

if([Calendar Date]>= date('31-May-2018'),'DD-MMM-YYYY') and [Calendar Date]<=date(max([Calendar Date],'DD-MMM-YYYY'),num(Sum({\$< [PA Age Days 365 Flag]= {'Y'},[Monthly Snapshot Flag]= {1},[%Confirmed PA Flag]={'Y'}>}[# PA Open]),'#,##0',null()))

Thanks..

Tags (1)
1 Solution

Accepted Solutions
Contributor III

## Re: Expression error

try like this

if([Calendar Date]>= date('31-May-2018','DD-MMM-YYYY')

and [Calendar Date]<=date(max([Calendar Date],'DD-MMM-YYYY')),

num(Sum({\$< [PA Age Days 365 Flag]= {'Y'},[Monthly Snapshot Flag]= 1,[%Confirmed PA Flag]={'Y'}>}[# PA Open]),'#,##0')

,null())

4 Replies
MVP

## Re: Expression error

One correction could be like:

if([Calendar Date]>= date#('31-May-2018','DD-MMM-YYYY') and ....

Note, date#() and a bracket correction..

Honored Contributor III

## Re: Expression error

try this

if([Calendar Date]>= date('31-May-2018','DD-MMM-YYYY') and [Calendar Date]<=date(max([Calendar Date]),'DD-MMM-YYYY'),

num(Sum({\$< [PA Age Days 365 Flag]= {'Y'},[Monthly Snapshot Flag]= {1},[%Confirmed PA Flag]={'Y'}>}[# PA Open]),'#,##0',null()))

Honored Contributor

## Re: Expression error

Try this:

if([Calendar Date]>= date#(('31-May-2018'),'DD-MMM-YYYY') and

[Calendar Date]<= date#(max([Calendar Date]),'DD-MMM-YYYY'),

num(Sum({\$<[PA Age Days 365 Flag]= {'Y'},[Monthly Snapshot Flag]= {1},[%Confirmed PA Flag]={'Y'}>}

[# PA Open]),'#,##0'),null())

Bracket misplaced in 3 places.

Contributor III

## Re: Expression error

try like this

if([Calendar Date]>= date('31-May-2018','DD-MMM-YYYY')

and [Calendar Date]<=date(max([Calendar Date],'DD-MMM-YYYY')),

num(Sum({\$< [PA Age Days 365 Flag]= {'Y'},[Monthly Snapshot Flag]= 1,[%Confirmed PA Flag]={'Y'}>}[# PA Open]),'#,##0')

,null())