Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm looking for help to configure a calendar in my Qlik app using two different date axes. My main date field is based on the sales date. However, I also need to display the full year of Target data, which is already complete for this year.
The issue is that the Target data only appears up to May 2025 — because it's limited by the sales calendar. In reality, the Target data includes values for the entire year (with fields for Year, Month, and Quarter), but I can’t visualize anything beyond the last available sales date.
How can I configure my calendar or model so that I can show the complete Target data for the year, regardless of the sales date?
Thanks in advance for your help!
It sounds like you should create a master calendar with the range of dates you need, and use dimensions from it. See here: https://community.qlik.com/t5/QlikView-App-Dev/Creating-A-Master-Calendar/td-p/341286
I'm not completely sure though how you want to use those two different date dimensions in combinations, but creating a master calendar could be a start for you.
Thank you for your answer
I have already a MasterCalendar:
sub MasterCalendar (DATE)
[MasterCalendar]:
load
// --------------------------------------- Grain = Year ----------
Year as Year,
YearStart(Date) as YearStart,
if(Mod(Year,400)=0,1,if(Mod(Year,100)=0,0,if(Mod(Year,4)=0,1,0))) as IsLeapYear, // Année bissextile
// --------------------------------------- Grain = Quarter ----------
Dual('Q' & Quarter, Quarter) as Quarter,
QuarterStart(Date) as QuarterStart,
Dual(Year(Date) & ' Q' & Quarter, QuarterStart(Date)) as YearQuarter,
// --------------------------------------- Grain = Month ------------
Month as Month,
MonthStart(Date) as MonthStart,
Date(MonthStart(Date),'YYYY MMM') as YearMonth,
Mod(Month - 1,3) + 1 as MonthOfQuarter,
// --------------------------------------- Grain = Week --------------
WeekYear(Date) & '-' & Week(weekstart(Date)) as WeekYear,
WeekDay(Date) as WeekDay,
week(Date) as Week,
// --------------------------------------- Grain = Day --------------
Date as [$(DATE)],
Date - YearStart(Date) + 1 as DayOfYear,
Date - QuarterStart(Date) + 1 as DayOfQuarter,
Day(Date) as DayOfMonth,
Date as Date
;
load // ------------------------------------------------------------------
Year(TempDate) as Year,
Ceil(Month(TempDate)/3) as Quarter,
Month(TempDate) as Month,
TempDate as Date
;
//=== Generate a temp table of dates === Génére toutes les dates entre la date Min et la date Max trouvées dans le load ci-dessous
load
date(mindate + IterNo()) as TempDate,
maxdate
while mindate + IterNo() <= maxdate
;
//=== Get min/max dates from Field using symbole table & pointers ===/
load
min(FieldValue('$(DATE)', recno())) - 1 as mindate,
max(FieldValue('$(DATE)', recno())) as maxdate
autogenerate FieldValueCount('$(DATE)');
End Sub
But it's not take all the present data in the year of my target. I need to show all the data of my target this year, but in Qlik it's stop in May2025 (because it's based on the date of the sales)
So you have two completely different dates, one "main" (that you probably based your master calendar on) and one "target". Are those in two different tables, or is it one table and for each row those dates are the same (or null), or what does the data look like?
So I need another masterCalendar just for the Target?