Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Partner
Partner

Limit the the number of rows by reference to date

Hi,

I have the following in SQL (the ListDate is classified as varchar data type)

    

MinMaxItem NumberPrimary DescriptionListDate
3101000000Cups Slim

04-04-2017

which I load into QlikView as

Report:
LOAD

[Min],

[Max],
[Primary Description],
[Item Number],
ListDate,
Date(Date#(ListDate, 'DD-MM-YYYY')) as LDate,

Month(Date#(ListDate, 'DD-MM-YYYY'))  as LDateMonth;

SQL SELECT *
FROM "Report"
;

I want to restrict the the number of rows by reference to date e.g. I only want the rows with the dates that are within 90 days as of today. How can I do that?

Thanks

1 Solution

Accepted Solutions

Re: Limit the the number of rows by reference to date

Ideally, I would suggest you to restrict this in SQL itself as you don't want to bring extra data into QlikView which you are going to drop in QlikView without processing it. But if you want to do it in QlikView, you can try this

Report:
LOAD [Min],

    [Max],
    [Primary Description],
    [Item Number],
    ListDate,
    Date(Date#(ListDate, 'DD-MM-YYYY')) as LDate,

    Month(Date#(ListDate, 'DD-MM-YYYY'))  as LDateMonth

Where Date#(ListDate, 'DD-MM-YYYY') >= Today() - 90;

SQL SELECT *
FROM "Report";

View solution in original post

2 Replies

Re: Limit the the number of rows by reference to date

Ideally, I would suggest you to restrict this in SQL itself as you don't want to bring extra data into QlikView which you are going to drop in QlikView without processing it. But if you want to do it in QlikView, you can try this

Report:
LOAD [Min],

    [Max],
    [Primary Description],
    [Item Number],
    ListDate,
    Date(Date#(ListDate, 'DD-MM-YYYY')) as LDate,

    Month(Date#(ListDate, 'DD-MM-YYYY'))  as LDateMonth

Where Date#(ListDate, 'DD-MM-YYYY') >= Today() - 90;

SQL SELECT *
FROM "Report";

View solution in original post

Partner
Partner

Re: Limit the the number of rows by reference to date

Thanks Sunny,

That worked quite well.

Shamit