Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
...I just can't seem to figure it out!
I have two fields, BeautyParadeDate and SiteVisitDate.
I'd like to do the following;
If both fields are blank then state "Tender", else, state BeautyParade or SiteVisit dependant on which date is greater.
For some reason I cannot get this to work
Can anyone help please?
Nothing seemed to work with this so I had to build a separate indicator field for each status and work it out from there. Thanks anyway people
Samuel,
Is this an script issue or are you stacked building an expression? Please post sample as well.
Marc.
I'm trying to achieve it within the script, I've literally got one line of data at the moment with two fields!
Beauty Parade Date | Site Visit Date |
03/02/2015 |
If they are both blank then "Tender" else state the one with the max date. The result of the above should say "Site Visit"
Maybe this:
Alt(If(BeautyParadeDate > SiteVisitDate, BeautyParadeDate, SiteVisitDate), 'Tender') as SiteVisit
or
If(IsNull(BeautyParadeDate) and IsNull(SiteVisitDate), 'Tender', If(BeautyParadeDate > SiteVisitDate, BeautyParadeDate, SiteVisitDate)) as SiteVisit
HTH
Best,
S
Tested the following code with some dummy data and it seems to work just as you wanted:
Table:
LOAD * INLINE [
BeautyParadeDate, SiteVisitDate
01/01/2015, 12/31/2014
,
03/15/2013, 06/15/2013
];
Table2:
LOAD *,
Alt(If(BeautyParadeDate > SiteVisitDate, BeautyParadeDate, SiteVisitDate), 'Tender') as SiteVisit
Resident Table;
Best,
S
Must be something odd going on then as I tried these solutions before and all I get is Tender, for some reason the dates are being ignored
May be the dates you are using are picked up by QlikView as text instead of date. You might want to use Date# function if that is the case.
Best,
S
As suggested by sunindia, it is working. Please could you add sample code here which you are using .
Nothing seemed to work with this so I had to build a separate indicator field for each status and work it out from there. Thanks anyway people