Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
suvechha_b
Creator III
Creator III

how to get the date ??

How can I caluclated in qlikview a date ??

How to achieve this ??

I have a fieldname batch_expiry = 2013/06/12

I have another field days like 60,90,30

I have to subtract 2013/06/12 - 60 and get the date ??

The answer should be 2013/04/12

9 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If your date is a normal QV date field, then the date is just a number, so you can do

     =Date(Batch_Expiry - 60)

The Date() function ensures that the result still shows in date format, rather than number format

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
alexandros17
Partner - Champion III
Partner - Champion III

To add a number of days, transform your date to numeric format: num(myDate) and subtract the quantity; at the end transforma again in date:

Date(num(myDate)-30)

Hope it helps

pennetzdorfer
Creator III
Creator III

Does Qlikview recognize your datefield (batch_expiry) as date? You can check that by creating a listbox and changing the number format to integer ...

If not, you will have to convert your date field in the script:

date(date#(batch_expiry,'YYYY/MM/DD'),'YYYY/MM/DD') as batch_expiry

For further information on date fields, see Henric Cronströms Technical Brief: http://www.qlikcommunity.com/docs/DOC-3102

Regards,

Florian

er_mohit
Master II
Master II

try this in text object

=Date(Date#('2013/06/12','YYYY/MM/DD')-60,'YYYY/MM/DD')

Not applicable


Please find the solution given below:-

Regards

Vineet

Capture.PNG

Not applicable

Please stop refering to your own post in other topics. They will get answered if someone got an solution

Anonymous
Not applicable

What Jonathan is saying is 100 % correct i have also tested it.

anant

Not applicable

Yes vineet is correct