Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
anuradhaa
Partner - Creator II
Partner - Creator II

Add date condition in excel export

I have a CSV file and it has date format as 'd-mmm-yy' (9-Jan-11 etc). I want to use date in where clause when export this data to qlikview.

say i want date > '1-Jan-2016' how can i do that.

9 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

It is not possible to limit the data while exporting to Excel, it just exports whatever data is available in the chart.  To overcome this create a button and apply the file and then export using macro.

Useful Qlikview Macros

Regards,

jagan.

PrashantSangle

Hi,

Load *

from file

where date(dateField) > date(date#('1-Jan-2016'))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
manojkulkarni
Partner - Specialist II
Partner - Specialist II

something like

Load *

From test.csv

Where Date(DateField,'DD-MMM-YYYY') > '01-Jan-2016' ;

tresesco
MVP
MVP

I guess you meant import . If so, you can try like:

...

Where  Date(Date#(DateField, 'DD-MMM-YY') , 'DD-MMM-YYYY') > '1-Jan-2016' ;

anuradhaa
Partner - Creator II
Partner - Creator II
Author

what happens if date is like 'Mar 27, 2015' and it's as general

PrashantSangle

Hi,

QlikView allowed you to format date as per requirement .

For above format you can try

Date(DateField,'MMM DD,YYYY')

For details you can read blog written by Henric.

The Date Function

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
anuradhaa
Partner - Creator II
Partner - Creator II
Author

see attached csv.

Here i want to import data which has "Accepted at" in 2011.

Thanks

sunny_talwar

May be this:

SET DateFormat='D-MMM-YY';

Table:

LOAD Id,

    [Created at],

    [Accepted at]

FROM

testcsv.xlsx

(ooxml, embedded labels, table is Sheet1)

Where [Accepted at] > MakeDate(2011, 1, 1);


Capture.PNG

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you just want data which is Accepted In 2011 then use

Data:

LOAD Id,

     Date([Created at], 'MM/DD/YYYY') AS [Created at],

     Date([Accepted at], 'MM/DD/YYYY') AS [Accepted at]

FROM

(ooxml, embedded labels, table is Sheet1)

WHERE Year(Date([Accepted at], 'MM/DD/YYYY')) = 2011;

Hope this helps you.

Regards,

jagan.