Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i have the following required in expression.. i have 3 columns
closing date
last date
opening date
My condition is as below
if closing date is blank or null the take the date from opening date column ,if the opening date is null or blank then take the date from last date column
May be like this:
If(Len(Trim([Closing Date])) > 0, [Closing Date],
If(Len(Trim([Opening Date])) > 0, [Opening Date], [Last Date]))
hi sunny,
len is not working as many of the data is null or -
Hi,
Try This..
if(GetSelectedCount([closing date])=1,[Closing Date],
if(GetSelectedCount([Opening Date])=1,[Opening Date], [Last Date]))
If(Len(Trim([Closing date]))=0,If(Len(Trim([opening date])) > 0,[Opening date],[Last date]),[Closing date])
That's exactly why Sunny is suggesting to use the len(trim()) combo. It handlles empty fields, whitespace strings, Null values all in the same way. This is a best practice if you cannot expect the data source to return a single "no value present" indicator.
hi jayasselan ,
this is giving results but it only takes Last Date values......it is not considering even if opening dates are there
can you provide screenshot of the data?
hi peter,
If lenght is used .. i dont get any values.. not sure why.. but for example if i put
if (closing date) = '' or '-' ,date(opening date),-- it correctly takes from other column.. but if i put one if condition it does not work
So this means that the hyphen is actually present in your date fields? And not just the representation of a Null value in a QlikView object? You may want to change the zeroes in Sunny's expression into 1s.
If this still doesn't work, then we are lacking context details. Please upload an example document that exhibits this behavior. Thanks.
Peter