Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I want to use two fields that are not in the same table. I have a field called 'E Date' in one table and 'A Date' that is in the other table. I need to deduct 'A Date' from 'E Date' to come up with the difference. How would I do this?
Many Thanks
Rajesh Bhardwaj
Hi,
You can use the function Num, converting dates to num value like:
=num([E Date]) - num([A Date])
Assuming they're actual QlikView dates, you don't even need the num() function.
[E Date] - [A Date]
But that seems so simple that I have to assume you already tried it, Rajesh?
Is the problem that you want the difference stored in one of the two tables rather than calculated on the fly? Something else?
Hi,
If ur date in numeric formate like 20100101 then u have to seperate th eyear month and date and construct the date like
date(makedate(left(Date_1,4),mid(Date_1,5,2),right(Date_1,2)),'DD-MM-YYYY')
then deduct the both dates from each other.
Regards
Manesh
Manesh wrote:date(makedate(left(Date_1,4),mid(Date_1,5,2),right(Date_1,2)),'DD-MM-YYYY')
It's easier to use the date#() function, and the date() function will apply your default date format if none is specified. So:
date(date#(Date_1,'YYYYMMDD'))