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

record for single date

Hi Experts,

I have sales records for april month in a qvd.

I want to pick up the sales data for a single date.

for example, the qvd has date field starting from 01/04/2015 to 24/04/2015. Now i have to pick up sales records only for 22/04/2015.

How can i do that.

I have tried using match(), wildmatch(). but its not working.

Please give some suggestions.

1 Solution

Accepted Solutions
ankitaag
Partner
Partner

T1:

LOAD * INLINE [

    Date, Data

    01-04-2015, 96

    02-04-2015, 98

    03-04-2015, 17

    04-04-2015, 43

    05-04-2015, 60

    06-04-2015, 23

    07-04-2015, 94

    08-04-2015, 47

    09-04-2015, 96

    10-04-2015, 39

    11-04-2015, 70

    12-04-2015, 54

    13-04-2015, 24

    14-04-2015, 69

    15-04-2015, 83

    16-04-2015, 68

    17-04-2015, 68

    18-04-2015, 77

    19-04-2015, 42

    20-04-2015, 53

    21-04-2015, 21

    22-04-2015, 31

    23-04-2015, 98

    24-04-2015, 73

];

Store T1 into path\T1.qvd (qvd);

T2:

LOAD Date,

     Data

FROM

[path\T1.qvd]

(qvd)

where Date(Date,'DD/MM/YYYY')='22/04/2015';

View solution in original post

10 Replies
robert_mika
Master III
Master III

How does your data looks like?

If you choose the Date from Listbox what is happening?

Do you need to pick the day in front end or in script?

ankitaag
Partner
Partner

T1:

LOAD * INLINE [

    Date, Data

    01-04-2015, 96

    02-04-2015, 98

    03-04-2015, 17

    04-04-2015, 43

    05-04-2015, 60

    06-04-2015, 23

    07-04-2015, 94

    08-04-2015, 47

    09-04-2015, 96

    10-04-2015, 39

    11-04-2015, 70

    12-04-2015, 54

    13-04-2015, 24

    14-04-2015, 69

    15-04-2015, 83

    16-04-2015, 68

    17-04-2015, 68

    18-04-2015, 77

    19-04-2015, 42

    20-04-2015, 53

    21-04-2015, 21

    22-04-2015, 31

    23-04-2015, 98

    24-04-2015, 73

];

Store T1 into path\T1.qvd (qvd);

T2:

LOAD Date,

     Data

FROM

[path\T1.qvd]

(qvd)

where Date(Date,'DD/MM/YYYY')='22/04/2015';

View solution in original post

Not applicable
Author

hi Robert,

I have to filter the date in load script itself.

any suggestions please

ankitaag
Partner
Partner

Hi,

Please try this

LOAD Date,

     Data

FROM

[path\T1.qvd]

(qvd)

where Date(Date,'DD/MM/YYYY')='22/04/2015';

Not applicable
Author

HI Ankita,

thanks for the reply.

Its working

buzzy996
Master II
Master II

just use where condition in ur script load table

where date#(urdatefield,'DD/MM/YYYY')='24/04/2015';

rajkumarb
Creator II
Creator II

HI

Try Using one of this

where Datefieldname = ''22/04/2015';

where Datefieldname  >'21/04/2015' and Datefieldname <'23/04/2015';

where Date(Datefieldname,'DD/MM/YYYY')='22/04/2015';

mov
Champion III
Champion III

Maybe I"m missing something, but it doesn't work for me.  There are two problems:
1. Tables T1 and T2 have the same exact structure.  That means that T2 will be autoconcatenated to T1, so all the rows will be in the final table.
2. Date format is 'DD-MM-YYYY' in T1 (and qvd), but 'DD/MM/YYYY' in T2 "where" clause.  Nothing will be returned by T2 alone.

The working solution is:


T1:
...

Store T1 into path\T1.qvd (qvd);

T2:
NOCONCATENATE
LOAD Date,
...

where Date#(Date,'DD-MM-YYYY')='22-04-2015';

DROP TABLE T1;

ankitaag
Partner
Partner

Yes Michael,

drop table T1; should be written at the last of the script.

I missed that while copying the script;