Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

a1exand3r
New Contributor III

Filter Date Today-1

Hello,

i want to setup a filter based on todays date -1

Why this doesnt work?

thanks in advance

Tags (2)
1 Solution

Accepted Solutions
neelamsaroha157
Valued Contributor II

Re: Filter Date Today-1

It looks like you are trying this expression in NPrinting.

If yes, then can you try with =Date(now()-1).

You can add the format if your date format is different from default.

10 Replies

Re: Filter Date Today-1

May be this?

=Date(Today(1)-1)


Or Can you provide more info

a1exand3r
New Contributor III

Re: Filter Date Today-1

I have dates in a table, so i only want to get the rows with the dates before today.

The Values are like 07.05.2017  ......

Re: Filter Date Today-1

May be these approaches

1) Script

Load * from Table where DateField <= Date(Date#(DateField-1,'DD.MM.YYYY'),'DD-MM-YYYY');

Or

2) From End May be this?

If(DateField <= Date(Date#(DateField-1,'DD.MM.YYYY'),'DD-MM-YYYY'), DateField)

neelamsaroha157
Valued Contributor II

Re: Filter Date Today-1

It looks like you are trying this expression in NPrinting.

If yes, then can you try with =Date(now()-1).

You can add the format if your date format is different from default.

neelamsaroha157
Valued Contributor II

Re: Filter Date Today-1

Date with your existing format : =Date(now()-1, 'DD.MM.YYYY')

a1exand3r
New Contributor III

Re: Filter Date Today-1

Thanks, does exactly what i need

neelamsaroha157
Valued Contributor II

Re: Filter Date Today-1

Great..

Was it the date format or the function?

a1exand3r
New Contributor III

Re: Filter Date Today-1

I think now() creates a date in Systemformat so i dont specify the format.

I used now() instead of Today() and it worked for me.

fcipl_qlik
New Contributor

Re: Filter Date Today-1

I have the same issue but this solution is not working for me.

I tried with formatting and without formatting. but nothing works with date filter.

i have also tried formatting column in load and in the table. The column in database is of type - datetime

1.png

2.png

Community Browser