Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
WEBINAR April 23, 2025: Iceberg Ahead: The Future of Open Lakehouses - REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculation in script

Hi,

In the script i have 'date of joining' and 'date of seperation', can i calculate the 'vintage' in the script itself?

Regards,

Rahul

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

I am not sure how you calculate it (the expression for it) but you could create any field as an operation of other fields, during reload...

For example, if your code is similar to this:

load ID, Joining_Date, Separation_Date from....

You can create something like this:

Load ID,Joining_Date, Separation_Date, Separation_Date- Joining_Date as Duration from...

(that gives you the difference in days)

Hope this helps,

Erich

View solution in original post

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     You can use Interval() and Interval#() function for that.

      Look into Help for more details.

     Hope this will help you.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
erichshiino
Partner - Master
Partner - Master

I am not sure how you calculate it (the expression for it) but you could create any field as an operation of other fields, during reload...

For example, if your code is similar to this:

load ID, Joining_Date, Separation_Date from....

You can create something like this:

Load ID,Joining_Date, Separation_Date, Separation_Date- Joining_Date as Duration from...

(that gives you the difference in days)

Hope this helps,

Erich

Not applicable
Author

to slightly modify Erichs answer

if(isnull(Separation_Date),today(),Separation_Date)-Joining_Date

if there is no separation date then use todays date.

in days.

Not applicable
Author

Erich,

thanks for the reply... it worked

Thanks