Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
knkirubakaran
Contributor III
Contributor III

Define field based on date

Please help the to create status field based on date as per below. Attached source data.

imglo.PNG

2 Replies
devarasu07
Master II
Master II

Hi

try to use interval function to find date diff. and then create conditional statement to have year age group bucket.

Method 1:

like this

load *, if( Numberofdays<=31 or Numberofdays<=30 or Numberofdays<=28 or Numberofdays<=29, Dual('New Month',1),

if( Numberofdays >31 and (Numberofdays<=365 or Numberofdays<=366), Dual('1 Year',2),

if( Numberofdays >365 and (Numberofdays<=732 or Numberofdays<=731), Dual('2-3 Year',3),

if( Numberofdays >1460 and (Numberofdays<=1825 ), Dual('4-5 Year',4),Dual('>5 Years',5)

)))) as Bucket;

load *, Today()-[sales date] as Numberofdays;

LOAD [Cust ID],

     [Sales ITM],

     [sales date]

FROM

(ooxml, embedded labels, table is Sheet1);

Buckets

Capture.JPG

knkirubakaran
Contributor III
Contributor III
Author

Is it possible my month instead of days?