Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading data with filter on date

Hi,

I am new to QLikView. I need to load data from a txt file and put a condition 'where' on the date. The field INV_DATE is in format 2-7-2010 0:00:00. So when I try to edit script after load code it doesnt give me desired  results.

 

WHERE


INV_DATE > '01-01-2009'

 

WHERE


INV_DATE > '01/01/2009'

WHERE
INV_DATE > '01-01-2009 0:00:00'

I have tried all possible combinations but I am not able to get results. Please help.

Abhishek

17 Replies
jagannalla
Partner
Partner

Ok tell me from which data source ur getting this data. I mean either from sql or txt or excel or qvd file etc.

Not applicable
Author

txt file

jagannalla
Partner
Partner

Hello,

I've taken txt file and it is working fine for me. Please check txt file and qvw file once again.

Not applicable
Author

Weird it is.

You know I took your text file. Created a new qlikview file and loaded text file. and the codes do not work for me.

Attaching files for your reference.

thanks for all your efforts, Abhishek

jagan
MVP
MVP

Hi,

Try this script

Directory;

LOAD CUSTOMER_NAME,

     INV_DATE

FROM

Temptxt.txt

(txt, codepage is 1252, embedded labels, delimiter is ',', msq)

Where Date(Date#(INV_DATE,'M-D-YYYY hh:mm:ss')) > Date(Date#('1-1-2010 00:00:00', 'M-D-YYYY hh:mm:ss'))

;

Hope it helps you.

Regards,

Jagan.

View solution in original post

jagannalla
Partner
Partner

Use this code:

Directory;

LOAD CUSTOMER_NAME,

     INV_DATE

FROM

Temptxt.txt

(txt, codepage is 1252, embedded labels, delimiter is ',', msq)

Where Timestamp(Timestamp#(INV_DATE,'MM-DD-YYYY hh:mm:ss')) > Timestamp(Timestamp#('1-1-2010 00:00:00', 'M-D-YYYY hh:mm:ss'))

;

- If you attach sample file with sample data what you have, it helps others to solve the problem quickly. It saves ur's and others time also.

Cheers!!

Jagan

Not applicable
Author

Thanks a lott Jagan. It works!!!!!

and I apologise for takign up your time. I will keep in mind in future to load files.

Thanks a ton, Abhishek

Not applicable
Author

Hi Jagan,

I have loaded the data succesfully. What I need to do as a next step, give user an option on the tool to give a date range and see the output for that date range. The date range will be in DDMMYYYY format.

How to do this.

Please help, Abhishek