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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Indicator first of the month with the calender

Hello. I have build my calender. I have set a line with an indicator  end of the month. End of the month is green.This works

Also i have set a line with an Indicatorbegin of the month, the red line, this isn't working. Can anyone help me to get this working?

Datum_TEMP:

LOAD

Date($(vMinDatumNum)-1 + recno()) as d
Autogenerate $(vMaxDatumNum) - $(vMinDatumNum) + 1;


Kalender:
LOAD

*,
If(IndicatorEindeMaand = 1,'Ja','Nee') as RapportageEindeMaand,
If(IndicatorBeginMaand = 0,'Ja','Nee') as RapportageBeginMaand

;

LOAD

1
as #Kalenderdag,
Num(d) as _Datum.KEY,
d as Datum,
Capitalize(Month(d)) as Maand,
'Q'&(
Ceil(Month(d) / 3)) as Kwartaal,
Year(d) as Jaar,
Year(d)& Capitalize(Month(d)) as JaarMaand,
Year(d)& Week(d) as JaarWeek,
Day(d) as Dag,
Week(d) as Week,
WeekDay(d) as Weekdag,
If(Weekday(d)='za' or Weekday(d)='zo', 0,1) as Werkdag,
If(d = Floor(MonthEnd(Makedate(Year(d),Month(d)))),1,0) as IndicatorEindeMaand,
If(d = Floor(MonthStart(Makedate(Year(d),Month(d)))),0,1) as IndicatorBeginMaand



Resident Datum_TEMP;



Drop table Datum_TEMP;

Thank you


1 Reply
Anonymous
Not applicable
Author

It seems to be working fine here, RapportageBeginMaand has the value 'Ja' for each first day of the month.

I don't know why you set the IndicatorBeginMaand to 0 for the beginning of the month. You could switch to:

If(d = Floor(MonthStart(Makedate(Year(d),Month(d)))),1,0) as IndicatorBeginMaand

Makes it a bit easier to follow. Then of course you need to switch the other part as well:

If(IndicatorBeginMaand = 1,'Ja','Nee') as RapportageBeginMaand