Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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 - Specialist III
Partner - Specialist III

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 - Specialist III
Partner - Specialist III

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
Luminary Alumni
Luminary Alumni

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.

jagannalla
Partner - Specialist III
Partner - Specialist III

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