Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

how to remove last Date from table

Hi Friends

I want to remove last Date records from Table Dynamically

Eg:

Date

01/01/2016

02/01/2016

03/01/2016

Here I need to remove 03/01/2016. I need to do this dynamically why because after some time the date may be change. Guys can u please help me on this

Thanks & Regards

Abi

10 Replies
arulsettu
Honored Contributor III

Re: how to remove last Date from table

have you tried

Max(date)-1

Re: how to remove last Date from table

Can you tell us what is the purpose of removing last date ? Do you want to achieve it from front end or back end?

MVP
MVP

Re: how to remove last Date from table

Hi,

Try like this

Temp:

LOAD

Date,

'

'

'

FROM DataSource;

Left JOin(Temp)

LOAD

Max(Date) AS Date,

1 AS Flag

RESIDENT Temp;

Data:

Noconcatenate

LOAd

*

RESIDENT Temp

WHERE Flag <> 1;

DROP TABLE Temp;

Hope this helps you.

Regards,

Jagan.

vsudhakar
Contributor III

Re: how to remove last Date from table

max(date)-1

senpradip007
Valued Contributor III

Re: how to remove last Date from table

Try like:

Temp:

LOAD

Max(Date) as MxDate

FROM DataSource;


let vMaxDate = peek('Date', 0,'Temp');

Drop table Temp;

FinalTab:

Load *

FRM DataSource

Where Date < $(vMaxDate);

Digvijay_Singh
Honored Contributor III

Re: how to remove last Date from table

Try this -

t1:

Load * inline [

Date

01/01/2016

02/01/2016

03/01/2016 ];

Let vLast = FieldValue('Date',NoOfRows('t1'));

NoConcatenate

t2:

Load *

Resident t1

Where Date<>'$(vLast)';

DROP Table t1;

amit_saini
Honored Contributor III

Re: how to remove last Date from table

Hi,

Try:

Max(Date_Field ) as Latest_Date

and later

where Date_Field <> max(Date_Field);

Thanks

AS

MVP
MVP

Re: how to remove last Date from table

@Jagan

I think you need:

Data:

Noconcatenate

LOAd

*

RESIDENT Temp

WHERE Flag <> 1 Or IsNull(Flag);

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP
MVP

Re: how to remove last Date from table

@Jonathan

I guess

....

WHERE Flag <> 1 alone is good enough here. Am I missing something? The Isnull() would be implicit here.

Community Browser