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: 
Not applicable

Date Field is not picking correct value

Hi,

I have

[Start Date][Exp End Date]
23/02/201531/07/2015
07/05/201513/05/2015
13/03/201515/04/2015
07/07/201515/07/2015
01/06/201529/06/2015
01/06/201522/06/2015
01/07/201515/07/2015

i want to calculate  Duration =start date-end date with  condition [Project Type]-IT

So i wrote expression for Duration= Max({<[Project Type] = {IT}>}Date([Exp End Date]))-Min({<[Project Type] = {IT>}Date([Start Date]))

But its not picking any value.

pls suggest.

Labels (1)
6 Replies
sunny_talwar
MVP
MVP

Try this may be

=Max({<[Project Type] = {IT}>}Date#([Exp End Date], 'DD/MM/YYYY'))-Min({<[Project Type] = {IT>}Date#([Start Date], 'DD/MM/YYYY'))


=Max({<[Project Type] = {'IT'}>}Date#([Exp End Date], 'DD/MM/YYYY'))-Min({<[Project Type] = {'IT'}>}Date#([Start Date], 'DD/MM/YYYY'))

vardhancse
Specialist III
Specialist III

or else in script level also while loading we can write below script.

Date(Floor([Start Date]) as Start_Date,

Date(Floor([Exp End Date]) as End_Date

So that in entire dashboard we can use direct fields

Not applicable
Author

Still it didnt pick up..

sasiparupudi1
Master III
Master III

put this in a text box ans see if it returns the correct value

Max({<[Project Type] = {'IT'}>}Date#([Exp End Date], 'DD/MM/YYYY'))


or

MaxString({<[Project Type] = {IT}>}Date([Exp End Date]))

MarcoWedel
MVP
MVP

Typo:

Max({<[Project Type] = {IT}>}Date([Exp End Date]))-Min({<[Project Type] = {IT}>}Date([Start Date]))



hope this helps


regards


Marco


P.S.: no need for the Date() function as it is only formatting a numerical value, i.e.


=Max({$<[Project Type]={'IT'}>} [Exp End Date])-Min({$<[Project Type]={'IT'}>} [Start Date])


will also work.



MayilVahanan
MVP
MVP

Hi

For Difference, you can use like this

=Max({<[Project Type]={'IT'}>} [Exp End Date])-Min({<[Project Type]={'IT'}>} [Start Date])


No need date function in your case.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.