Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Creator II
Creator II

Picking updated date field from data

Hello all,

Please help me out from this logic,I am showing branch wise sales by taking Date-1 for calendar,Logic here i should apply here is If "Date-2" having  "-"  then i should take from Date-1 else i should consider a date from Date-2.
 
Branch    Date-1                    Date-2           Sales
A                14-06-2019             -                       1600
B                15-09-2015             -                       18000
C                12-04-2018        10-03-2017       3651
D                16-01-2015             -                       648
E                 02-05-2016       08-04-2017       5648

2 Solutions

Accepted Solutions
Highlighted
Master
Master

if(len([Date-2])<2,[Date-1],[Date-2]) as New_Date2,
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

Highlighted
Partner
Partner

Is your empty - values actually the string "-"  or is it just Qlikview that is presenting NULL values as -.

If they are NULL values then you can use the Alt() function

Alt([Date-2],[Date-1]) as Date

If its not null, but a string, then use the if solution suggested by @Taoufiq_ZARRA .

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post

2 Replies
Highlighted
Master
Master

if(len([Date-2])<2,[Date-1],[Date-2]) as New_Date2,
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

Highlighted
Partner
Partner

Is your empty - values actually the string "-"  or is it just Qlikview that is presenting NULL values as -.

If they are NULL values then you can use the Alt() function

Alt([Date-2],[Date-1]) as Date

If its not null, but a string, then use the if solution suggested by @Taoufiq_ZARRA .

Plees ekskuse my Swenglish and or Norweglish spelling misstakes

View solution in original post