Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Min and Max of dates not working ...

Hi,

I would like to add two varaiables fdate and tdate to CALENDAR object ,

But It is not working in LOAD ??

Please help me /

LOAD * INLINE [

  Country, Value, SalesDate

  USA, 12, 2013-01-04

  USA, 14.5, 2013-02-07

  USA, 6.6, 2013-03-03

  USA, 4.5, 2013-04-11

  USA, 7.8, 2013-05-19

  USA, 9.4, 2013-06-22

  UK, 11.3, 2013-01-31

  UK, 10.1, 2013-02-01

  UK, 3.2, 2013-03-2182

  UK, 5.6, 2013-04-15

  UK, 3.9, 2013-05-12

  UK, 6.9, 2013-06-06

];

Let fdate = DATE(Min(SalesDate), 'YYYY-MM-DD');

LET tdate = DATE(Max(SalesDate), 'YYYY-MM-DD');

1 Reply
swuehl
MVP
MVP

Try like

INPUT:

LOAD * INLINE [

  Country, Value, SalesDate

  USA, 12, 2013-01-04

  USA, 14.5, 2013-02-07

  USA, 6.6, 2013-03-03

  USA, 4.5, 2013-04-11

  USA, 7.8, 2013-05-19

  USA, 9.4, 2013-06-22

  UK, 11.3, 2013-01-31

  UK, 10.1, 2013-02-01

  UK, 3.2, 2013-03-2182

  UK, 5.6, 2013-04-15

  UK, 3.9, 2013-05-12

  UK, 6.9, 2013-06-06

];

MINMAX:

LOAD Min(SalesDate) as Min,

  Max(SalesDate) as Max

Resident INPUT;

  

Let fdate = Date(Peek('Min',0,'MINMAX'),'YYYY-MM-DD');

Let tdate = Date(Peek('Max',0,'MINMAX'),'YYYY-MM-DD');