Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

New calculated time field

Hi,

I am loading a table with the following two fields:

  1. Date of last payment
  2. Date of last purchase

I would like to create an additional field called "Days since last movement".

This must look at whatever is the latest date of the two above-mentioned fields, and then subtract that from TODAY's date.

Example:

  • Date of last payment - 2011/04/10
  • Date of last purchase - 2011/04/01
  • Days since last movement = 4

Possible?

Gerhard

1 Solution

Accepted Solutions
rwunderlich

today(1)-RangeMax(LastPurchase,LastPayment) as DaysLastMovement

View solution in original post

4 Replies
IAMDV
Luminary Alumni
Luminary Alumni

Create two variables...

vMaxLastPayment = Max({1} [Date of last payment])

vMaxLastPurchase = Max({1} [Date of last purchase])

Then use Max fucntion with the variables like this...

=Today() - Max($(vMaxLastPayment) , $(vMaxLastPurchase))

Not applicable

try this

load date2, date3, if(date2>date3, interval(date(today())- date(date2),'DD'), interval(date(today())- date(date3),'DD')) as movement

erichshiino
Partner - Master
Partner - Master

Try something like this:

Load *,

today()-if(LastPayment>LastPurchase,LastPayment,LastPurchase) as DaysLastMovement

resident table;

Regards,

Erich

rwunderlich

today(1)-RangeMax(LastPurchase,LastPayment) as DaysLastMovement