Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Nagaraju_KCS
Specialist III
Specialist III

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......

Labels (1)
6 Replies
swuehl
Champion III
Champion III

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() ;

Nagaraju_KCS
Specialist III
Specialist III
Author

Thanks for reply,

one more how to calculate how many years and months validity

jagan
Partner - Champion III
Partner - Champion III

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

Nagaraju_KCS
Specialist III
Specialist III
Author

Hi jagan,

i want months alsoo..

jagan
Partner - Champion III
Partner - Champion III

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.