Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
balrajahlawat
Champion
Champion

Syntax error

Hello,

What is wrong with this syntax??

=sum(if(Clearing_AUGDT >'31/Jan/2014' and [Posting Date_BUDAT]<='31/Jan/2014' , ([Amount in LC_DMBTR])))

Why its not working?

Please suggest.

Regards,

Balraj

9 Replies
tresesco
MVP
MVP

One reason could be mismatch in date format

Not applicable

Hi Balraj,

You can try this

=Sum(if((Date(Clearing_AUGDT,'DD/MMM/YYY')>Date('31/Jan/2014','DD/MMM/YYY)) and (Date([Posting Date_BUDAT],DD/MMM/YYY')<=Date(31/Jan/2014',DD/MMM/YYY')), ([Amount in LC_DMBTR]),0))

jyothish8807
Master II
Master II

Its better to change it into date format in script, so that it works properly in all tables and expression.

In script:

Load

Date(Clearing_AUGDT,'DD/MM/YYYY') as Clearing_AUGDT,

Date([Posting Date_BUDAT],'DD/MM/YYYY') as Posting Date_BUDAT

from.....................;

After this try the same script you used.Hope this help.

Regrds

KC

Best Regards,
KC
balrajahlawat
Champion
Champion
Author

not working

jagan
Luminary Alumni
Luminary Alumni

Hi,

Attach sample file so that it would be easier to check.

Regards,

Jagan.

balrajahlawat
Champion
Champion
Author

=sum({$<Clearing_AUGDT  ='>''31/Jan/2014', [D/CIndicator]={'S'}>} [Amount in LC_DMBTR])

Could you tell what is the syntax error?

Not applicable

From the field names (BUDAT), it seems you are working with SAP data. The dates in SAP are anyway trickier to work with. Check from qvd in what format the date is being stored and has the QV app recognised it as a date format.

One of the initial tests can be to check in a text box if a Num operation on the date field gives the correct number corresponding to that date.

tresesco
MVP
MVP

Correct syntax:

=sum({$<Clearing_AUGDT  ={'>31/Jan/2014'}, [D/CIndicator]={'S'}>} [Amount in LC_DMBTR])

jyothish8807
Master II
Master II

''31/Jan/2014'  is the error

=sum({$<Clearing_AUGDT  ={'>31/Jan/2014'}, [D/CIndicator]={'S'}>} [Amount in LC_DMBTR])

Try this.

Best Regards,
KC