Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

calender dates

Hi

I want when i open the dashboard by default dates should be selected as follows:-

For current year

1st day of current month and current year - one day before system date ie 1st april 2018 till 23rd april 2018

for previous year

1st day of current  month and previous year - one day before system date ie 1st april 2017 till 23rd april 2017

How to implement same?

Paint1.png

28 Replies
Anonymous
Not applicable
Author

Hi

I only want to display the default dates as first day of current month till one day before the system date so in that case my date should be displayed as 1st april 2018 - 24th april 2018.(under heading select date range for current year )

Similarly, for previous year dates should be displayed as 1st april 2017 - 24th april 2017(under heading select date range for previos year )

so how to implement the same ?

Paint1.png

sudhirpkuwar
Partner - Creator II
Partner - Creator II

Hi,

Check this

Anonymous
Not applicable
Author

what?

Anonymous
Not applicable
Author

can it be done using makedate function ?

Anonymous
Not applicable
Author

stalwar1‌ please help

sunny_talwar

Would you be able to share a sample to show what you have got

sudhirpkuwar
Partner - Creator II
Partner - Creator II

Did you check the attachment

It has calendar object as per your requirement....

Anonymous
Not applicable
Author

its not visible...please resend

Anonymous
Not applicable
Author

i cant use expression in calender as i have declared variable for calender and its used in expressions in charts as follows:-

=num(count({ stateA<Sold_Date = {">=$(vstart)<=$(vend)"} >}DISTINCT SAPCode),'#,##0.0')

following is the code for calender in script :-

for i=2015 to 2018

for j=1 to 12

step1:

LOAD

RecNo(),

MakeDate($(i),$(j),RecNo()) as Sold_Date

AutoGenerate(31);

NEXT j;

NEXT i;

step2:

LOAD Sold_Date,

year(Sold_Date) as Year,

month(Sold_Date) as Month,

Date(monthstart(Sold_Date), 'MM-YYYY') as MonthYear,

day(Sold_Date) as day,

week(Sold_Date)as Week,

QuarterName(Sold_Date) as Quater1,

Dual(Date(Sold_Date, 'DD MMM'), (Month(Sold_Date) * 100) + Day(Sold_Date)) as Day,

WeekDay(Sold_Date) as weekday,

if(Ceil(Month(Sold_Date)/3)=1,'Q1',IF(Ceil(Month(Sold_Date)/3)=2,'Q2',IF(Ceil(Month(Sold_Date)/3)=3,'Q3',IF(Ceil(Month(Sold_Date)/3)=4,'Q4')))) as Quarter,


date(Sold_Date) as OrderDate

Resident step1;

drop Table step1;

Anonymous
Not applicable
Author

Here  if i am using in triggers as today-1 its functioning well for current year ending date. I am getting result as 24th april 2018

but its not functioning well for previous year ending date ie if i am using today -2 its giving values as 23rd april 2018 whereas i want values 24th april 2017 so how to  implement the same?