Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to compare five different dates to find the minimum,maximum and variance of both of them.I am not able to compare all the dates together.Actually i am using the 'If' Statement in the expression while making a straight table
if(Date1<Date2,Date1,
if(Date1<Date3,Date1,
if(Date1<Date4,Date1,
if(Date1<Date5,Date1,
f(Date2<Date1,Date2,
if(Date2<Date3,Date2,
if(Date2<Date4,Date2,
if(Date2<Date5,Date2,
f(Date3<Date2,Date3,
if(Date3<Date1,Date3,
if(Date3<Date4,Date3,
if(Date3<Date5,Date3,
if(Date4<Date2,Date1,
if(Date4<Date3,Date1,
if(Date4<Date1,Date1,
if(Date4<Date5,Date1,
))))) for minimum
but not getting the appropriate result.Can anybody help me out,what can i use instead of 'If' Statement.I am attaching the sample data and sample qvw and a snapshot.In the snapshot,you can see the minimum and maximum date are not correct. Please help me out.
Hi Atul,
First, you need to parse from string to date. To determine the min/max you can use RangeMin(), RangeMax().
Have a look at the attached document.
Regards,
David
Hi Atul,
First, you need to parse from string to date. To determine the min/max you can use RangeMin(), RangeMax().
Have a look at the attached document.
Regards,
David
Hello, Atul!
Try this:
if(Date1>Date2 and Date1>Date3 and Date1>Date4 and Date1>Date5, Date1,
if(Date2>Date1 and Date2>Date3 and Date2>Date4 and Date2>Date5, Date2,
if(Date3>Date1 and Date3>Date2 and Date3>Date4 and Date3>Date5, Date3,
if(Date4>Date1 and Date4>Date2 and Date4>Date3 and Date4>Date5, Date4,
if(Date5>Date1 and Date5>Date2 and Date5>Date3 and Date5>Date4, Date5))))) as maximum
And vice versa for minimum.
I'm not quite sure if I had understood what do you are want to do but I would try it in this way:
rangemin(Date1,Date2,Date3,Date4,Date5)
and
rangemax(Date1,Date2,Date3,Date4,Date5)
and subtract them for the difference.
- Marcus