Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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

Re: Picking updated date field from data

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 "

View solution in original post

Highlighted
Partner
Partner

Re: Picking updated date field from data

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

Re: Picking updated date field from data

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 "

View solution in original post

Highlighted
Partner
Partner

Re: Picking updated date field from data

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