Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Mater calendar with out date

Hi,

The table doesn't have a date field.But my user asks to provide the date from last two years.

Is there any way to get the data.

Thanks..

6 Replies
Anil_Babu_Samineni

Yes, we can create

tabCalendar: 

LOAD *, 

     Day(Date) as Day, 

     WeekDay(Date) as WeekDay, 

     Week(Date) as Week, 

     WeekName(Date) as WeekName,

     Month(Date) as Month,

     MonthName(Date) as MonthName, 

     Dual('Q'&Ceil(Month(Date)/3),Ceil(Month(Date)/3)) as Quarter, 

     'Q'&Ceil(Month(Date)/3) & '-' & Year(Date) as QuarterYear,

     QuarterName(Date) as QuarterName, 

     Year(Date) as Year, 

     Day(Date) & '-' & Month(Date) as DayMonth,

     'Week'&Ceil(Day(Date)/7) as WeekNum,

     WeekYear(Date) as WeekYear;   

LOAD Date(MinDate+IterNo()-1) as Date 

While MinDate+IterNo()-1 <= MaxDate; 

LOAD MakeDate(2015) as MinDate, 

     Now() as MaxDate

AutoGenerate 1;

Note: It will return from Jan 01 2015 to Till date

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ahaahaaha
Partner - Master
Partner - Master

Hi,

As variant

Dates:

LOAD

Date(Date('01.01.2016') + RecNo() - 1) as CalDate

autogenerate(Today() - Date('01.01.2016') + 1);

Regards,

Andrey

avinashelite

Without date how do you want to link the master calendar with you data ? if you simply join then it will become a cross join and Fact will get duplicated for each day ..

Not applicable

Hi Anil,

What ever you suggested is working fine for me also because i tested the script as well, but the question is he don't have DATE column.

Can you please explain once again

Thanks,

Siva

vinieme12
Champion III
Champion III

if you don't have a date field do you have any Year, YEarMonth or MOnthYEar fields??

But my user asks to provide the date from last two years.


I assume you want to filter data while loading into script?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anil_Babu_Samineni

His Question is simple. He wants only 2 Years data even Date field is not exist. That is the case, We are making Date field for customer.

That is how it deserve for below process. When ever he want to Club with Master calendar then it big deal. That is the case we can do with All associative in Master calendar also. At least he must have one sequential field with Fact table that is the case we can map with that.

Even if we have atleast Year or month field with you that would be better to create

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful