Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qv_testing
Specialist II
Specialist II

calculate current date

Hi Community,

i have a one product table

table:

start_date           end_date

12/03/2013          12/03/2015

09/11/2013          12/02/2019

25/09/2013          12/08/2020

05/06/2013          12/12/2015

how to calculate current date in between st_date and end_date..

based on start and end dates..

using where condition (scripting level)

Thanks in Advance......

6 Replies
swuehl
MVP
MVP

Maybe like

Set DateFormat = 'DD/MM/YYYY';

LOAD * INLINE [

start_date,           end_date

12/03/2013,          12/03/2015

09/11/2013,          12/02/2019

25/09/2013,          12/08/2020

05/06/2013,          12/12/2015

05/06/2013,          11/09/2013

31/12/2013,          01/01/2020

]

where start_date <= today() and end_date >= today() ;

qv_testing
Specialist II
Specialist II
Author

Thanks for reply,

one more how to calculate how many years and months validity

jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

=Year(end_date) - Year(start_date)

Regards,

Jagan.

Not applicable

Hi,

Can you give some more details, because current date will be today () but you are asking between St_Date and End_Date.

What if we do not have current date between those ranges?

What are you planing to get out of that?

Regards,
NR

qv_testing
Specialist II
Specialist II
Author

Hi jagan,

i want months alsoo..

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

=Floor((Year(end_date) *12 - Year(start_date) * 12) /12) & ' Years ' &  Mod(((Year(end_date) *12 - Year(start_date) * 12) ), 12) & ' Months'

Regards,

Jagan.