Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
carlosh61
Creator
Creator

Using two conditionals in expression

Hello

I use QV as a final user so I am not skilled in programming and how QV works, special in Set Analysis

I need to get the subtract of two dates: Date Received - Purchase Date in order to calculate the Days Passed.  If the Date Received is blank, the operation must be the Actual Date (Today) - Purchase Date.

Thank you very much

two conditionals.JPG

7 Replies
marcioarruda
Creator III
Creator III

if(isNull([Date Received]), Today() - [Purchase Date], [Date Received] - [Purchase Date])

Vegar
MVP
MVP

You could user the alt() function like this:

Alt([Date Received], Today()) - [Purchase Date]

Anil_Babu_Samineni

Try this too

If(Interval([Date Received]-[Purchase Date],'d') > '0', Date(Interval([Date Received]-[Purchase Date]),'DD/MM/YYYY'), Date(Interval(Today()-[Purchase Date]),'DD/MM/YYYY'))


OR


If([Date Received] = ' ', Date(Interval(Today()-[Purchase Date]),'DD/MM/YYYY'), Date(Interval([Date Received]-[Purchase Date]),'DD/MM/YYYY'))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
carlosh61
Creator
Creator
Author

Thank you Anil Babu.

The result of your expression is a date format 'DD/MM/YYYY' and I need it in day numbers.

The expressions provided by Marcio Arruda and Vegar Lie Arntsen are working the way I need

Thanks to all of you

Vegar
MVP
MVP

I'm pleased that you found an answer to your question.

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

/Vegar

Anil_Babu_Samineni

You can use networkdays  with two date fields.  And you want  to calculate  all  days  right  if so use

Networkdays(date1, date2)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
carlosh61
Creator
Creator
Author

Thank you so much.