Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Top 1

Hi All

I needed help with trying to obtain the lastIDChagedate to a Transactiondate.

Qvw Attached.

Basically i want the last lastIDChagedate against a transaction.

Currently i am getting many.

Eg

On TransactionDate 02/02/2015 The Last LastIDchangedate was 22/06/2007

On TransactionDate 02/07/2015 The Last LastIDchangedate was 22/06/2015

I needed to filter the last ID based on these dates.


In script please not UI

Any ideas please?

Thanks

27 Replies
Anonymous
Not applicable
Author

The Output is the column Date i need

MK_QSL
MVP
MVP

Can you provide output here!

Anonymous
Not applicable
Author

AccountTransactionDateIDLastIDChangeDateDate i Need
102/02/2015105022/06/200722/06/2007
102/02/2015123422/06/201522/06/2007
102/02/2015142322/06/2007

22/06/2007

102/07/2015105022/06/200709/06/2015
102/07/2015123409/06/201509/06/2015
102/07/2015142318/08/201009/06/2015
MK_QSL
MVP
MVP

Test:

LOAD * INLINE [

    Account, TransactionDate, ID,    LastIDChangeDate

    1, 02/02/2015,  1050,  22/06/2007

    1, 02/02/2015,  1423,  22/06/2007

    1, 02/02/2015,  1234,  22/06/2015

    1, 02/07/2015,  1050,  22/06/2007

    1, 02/07/2015,  1423,  18/08/2010

    1, 02/07/2015,  1234,  09/06/2015

];

Left Join (Test)

Load

  Account,

  TransactionDate,

  Date(Max(LastIDChangeDate)) as MaxDate

Resident Test

Group By Account, TransactionDate;

Left Join (Test)

Load

  Account,

  TransactionDate,

  MaxDate as RequiredDate

Resident Test;

MK_QSL
MVP
MVP

Why

22/06/2007 for 02/02/2015 (as 22/06/2007 is lowest date) and

09/06/2015 for 02/07/2015 (as 02/07/2015 is highest date)

!!!!!!

Anonymous
Not applicable
Author

try i  this way

maxdate:

load

max(lastchagedate) as maxdate

let vmaxdate=peek(maxdate,0,maxdate)

Anonymous
Not applicable
Author

Hi Vsudhakar

Can you give example with the script please?

Thanks

Test: 

LOAD * INLINE [ 

    Account, TransactionDate, ID,    LastIDChangeDate 

    1, 02/02/2015,  1050,  22/06/2007 

    1, 02/02/2015,  1423,  22/06/2007 

    1, 02/02/2015,  1234,  22/06/2015 

    1, 02/07/2015,  1050,  22/06/2007 

    1, 02/07/2015,  1423,  18/08/2010 

    1, 02/07/2015,  1234,  09/06/2015 

]; 

Anonymous
Not applicable
Author

Still not working

MK_QSL
MVP
MVP

Why

22/06/2007 for 02/02/2015 (as 22/06/2007 is lowest date) and

09/06/2015 for 02/07/2015 (as 02/07/2015 is highest date)

!!!!!!

Anonymous
Not applicable
Author

AccountTransactionDateIDLastIDChangeDateMaxDateRequiredDate
102/02/2015105022/06/200722/06/201522/06/2015
102/02/2015123422/06/201522/06/201522/06/2015
102/02/2015142322/06/200722/06/201522/06/2015
102/07/2015105022/06/200709/06/201509/06/2015
102/07/2015123409/06/201509/06/201509/06/2015
102/07/2015142318/08/201009/06/201509/06/2015

For TransactionDate 02/02/2015 you have requireddate as 22/06/2016

But this date did not exist on 02/02/2015, The LastIDChangeDate was 22/06/2007

I want the last LastIDChangeDate for a Transaction so if the LastIDChangeDate  is more than Transaction date ignore this one and give me the max LastIDChangeDate  before the Transactiondate


Hope this makes more clearer