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

date calculation from today

Hi I am looking for equation that will do following.

Fields:

ServicePurchaseDate

hours purchase

hours worked

if ServicePurchasedate is less then 12 months (from current selection) (or from today)  then hours purchase - hours worked. if not then show 0. If hours worked acceds hours purchase then show negative number

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe something like

=if([ServicePurchaseDate] > addmonths( today() ,-12), [hours purchases] - [hours worked],0)

View solution in original post

4 Replies
Not applicable

Hi,

just to be sure to well understand your question, could you please give us an example of what you're looking for?

Thanks

Giampiero

yvesqlik
Partner - Contributor III
Partner - Contributor III

if(year2date(ServicePurchaseDate),hours purchase-hours worked,0)

userid128223
Creator
Creator
Author

if ServicePurchaseDate is less then 12 months from current date, then hours purchase - hours worked.

thanks

swuehl
MVP
MVP

Maybe something like

=if([ServicePurchaseDate] > addmonths( today() ,-12), [hours purchases] - [hours worked],0)