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

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

Date Subtraction

I have two fields 'Event Date' and a variable vOnSaleDate.

What I want to do is find the amount of time remaining (in a percentage) until an 'Event Date' relative to the vOnSaleDate and today's date. c

I have no idea how to structure this correctly, however this is how I envision the expression functioning.

=(([Event Date] - Today's Date)/([Event Date] -(vOnSaleDate))

Ultimately, if vOnSaleDate = '9/16/2017', the 'Event Date' is 10/5/17' and today's date is 09/20/2017, I want to end up with 83%, indicating that there is 83% of time remaining until the event date relative to the on-sale date.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Or this

=([Event Date] - Today())/([Event Date] - vOnSaleDate)

View solution in original post

5 Replies
sunny_talwar
MVP
MVP

May be this

=([Event Date] - Today())/([Event Date] - $(vOnSaleDate))

sunny_talwar
MVP
MVP

Or this

=([Event Date] - Today())/([Event Date] - vOnSaleDate)

evansabres
Specialist
Specialist
Author

This is what I have in my original question, that should work?

sunny_talwar
MVP
MVP

I think so... beside you had Today's Date and I replaced it with Today()... and then there were some extra parenthesis that i got rid of ... So, in your current state your expression would probably have not worked.... but yes, in general your expression should work

its_anandrjs
Champion III
Champion III

Try this

= ( ( ( [Event Date] - Today() ) / ( [Event Date] - (vOnSaleDate) ) ) * 100


Or


= ( ( ( [Event Date] - Today() ) / ( [Event Date] - $(vOnSaleDate) ) ) * 100