4 Replies Latest reply: Jul 25, 2016 9:17 AM by Clever Anjos

# Problem with calendar

Hi,

I have the following Code:

```Sales
date(d_date,'DD.MM.YYYY') as d_date,
Sale
FROM
[D:\QlikView\QVD\Tickets_DATA.qvd]
(qvd);

Concatenate
Bonus:
date(d_date,'DD.MM.YYYY') as d_date,
Bonus
FROM
[D:\QlikView\QVD\Bonus_DATA.qvd]
(qvd);

```

and a calendar:

```//-----------------------------------------------------------------------------------------------------------------------------
LET vMinBetDate = num('01.01.2016');
LET vMaxBetDate = today()-1;

TempCalendar_Betday:
\$(vMinBetDate) + Iterno()-1                     as TempNum,
Date(\$(vMinBetDate) + IterNo() - 1)             as TempDate
AutoGenerate 1 While \$(vMinBetDate) + IterNo()-1 <= \$(vMaxBetDate);

Calendar_Betday:
date(TempDate,'DD.MM.YYYY')                            as d_date,
weekday(TempDate)                                    as Weekday,
week(TempDate)                                         as Week,
Year(TempDate)                                          as Year,
Month(TempDate)                                       as Month,
weekyear(TempDate)*100+week(TempDate)                 as YearCW,
year(TempDate)*100+month(TempDate)                     as YearMn,
num(month(TempDate))                                 as MonthNr

Resident TempCalendar_Betday
Order By TempDate ASC;

drop table TempCalendar_Betday;

////-----------------------------------------------------------------------------------------------------------------------------

```

My problem is if i select a Month or MonthNr I get only i get only data from table Sales.

• ###### Re: Problem with calendar

Perhaps Bonus doesn't contain any dates from 2016. Or perhaps the values in its d_date field are not dates but text values.

• ###### Re: Problem with calendar

Please run only this piece of code and inspect the values of d_date

1. Bonus:
3.      date(d_date,'DD.MM.YYYY') as d_date,
4.      Bonus
5. FROM
6. [D:\QlikView\QVD\Bonus_DATA.qvd]
7. (qvd);
• ###### Re: Problem with calendar

d_date was a timestamp.

Thanks for the help.