Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
krishnagutha1294
Partner - Contributor II
Partner - Contributor II

Comparing 2 date fields

Hi All

I have The data like below

Table1:
LOAD * INLINE [
    Product, order date, Delivery date, Status
    Pen, 01/01/2020, 05/01/2020, Deliverd
    Book, 12/01/2020, Null, NULL
    Paper, 22/02/2020, 20/02/2020, Deliverd
    Pencil, 05/05/2020, 10/05/2020, Deliverd
];

Now I want to calculate Count(Product) where Delivery date > Order date
Along with null values
That means count is 3(2 delivered and 1 Null)

Kindly can anyone help me how to resolve .

Thanks In Advance

11 Replies
Kushal_Chawda

@krishnagutha1294  Sorry for late reply as notification issue.  To get the desire output either you need to have a measure. I had assumed that you might have some measure in your table in which you can put set analysis to get desire output. But if you don't have any measure then you  can slightly change the condition

Data:
LOAD *,
     if([Delivery date]>[order date] or (len(trim([Delivery date]))=0 or len(trim([order date]))=0),Product,null()) as Product_new;
LOAD * INLINE [
    Product, order date, Delivery date, Status
    Pen, 01/01/2020, 05/01/2020, Deliverd
    Book, 12/01/2020, ,  
    Paper, 22/02/2020, 20/02/2020, Deliverd
    Pencil, 05/05/2020, 10/05/2020, Deliverd
];

 

Now you can add below Product_new dimension in you table instead of Product.  Also check "suppress null value" option to get desire output

krishnagutha1294
Partner - Contributor II
Partner - Contributor II
Author

Thanks its working