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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Selections on list box and calendar object

Hi All,

I have list box with year and a calendar object .

Lets assume if i select 21/2/14 from calendar object and year 2012 from list box.I am getting desired results.Now if i changed the year for the same day in the calendar ,the calendar object is getting reset.I want to make it as it as until i change the date .

Do i have to write a macro for this .

8 Replies
Kushal_Chawda

First Select the Year then Date

Anonymous
Not applicable
Author

Hi

Thanks for reply !!

If i want to select the another year for same date .then calendar is getting cleared .

Thanks

Kushal_Chawda

Yes, because the Date which you have selected is not from the Year which you have Selcted

jonathandienst
Partner - Champion III
Partner - Champion III

Sounds like you need day/month/year selectors, rather than date selectors. If you select a date and then a different year, QV has to clear the date because the selections are incompatible. If you have month and day fields, then you can change the year.

You could have the calendar linked to a variable and use the OnInput or OnChange events on the variable to fire actions to set the day and month fields (and year?) to the date selected in the calendar.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thanks !!

Probably GetcurrentSelections(Date)

Anonymous
Not applicable
Author

Hi

I ttried your solution but i couldn't get dsired result

Anonymous
Not applicable
Author

Ignore the above attachment

please find the below code.

Here is my full code from the datamodel .

Let varMinDate = Floor(WeekStart(Date#('1-1-2014', 'D-M-YYYY')));

Let varMaxDate = Floor(WeekEnd(Date#('31-7-2015', 'D-M-YYYY')));

Cal:

LOAD

$(varMinDate) + Iterno()-1 As Num,

Date($(varMinDate) + IterNo() - 1) as TempDate

AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);

left Join(Cal)

load TempDate as DATE_KEY

Resident Cal;

NoConcatenate

Cal_TimeGranule:

Load *, 'YTD' as TimeGranule

Resident Cal where DATE_KEY  >=  YearStart(TempDate) and DATE_KEY <= TempDate;

//Bringing Accumulated MTD granule

Concatenate

Load *, 'MTD' as TimeGranule

Resident Cal where DATE_KEY >=  monthstart(TempDate) and DATE_KEY<=TempDate;

//Bringing Accumulated Day granule

Concatenate

Load * , 'Day' as TimeGranule

Resident Cal

where DATE_KEY=TempDate;

DROP Table Cal;

CAL:

Load

      TempDate as CAL_DATE,

    Month(TempDate) as SALES_MONTH,

    Year(TempDate) as SALES_YEAR,

    MonthName(TempDate) as SALES_MONTHNAME,

    'Q' & Ceil(Month(TempDate)/3) AS SALES_QUARTER,

    DayNumberOfYear(TempDate) as DayNumberOfYear,

    Day(TempDate) as DayNumberOfMonth,

    DayNumberOfQuarter(TempDate) as DayNumberOfQuarter,

    num(Month(TempDate)) as MonthNum

    Resident Cal_TimeGranule;

From the above code.

I made calendar object with CAL_DATE field and List box with TimeGranule field which consists of MTD,YTD,Day

Lets assume if i select 21/2/14 from calendar object and list box mtd from list box.I am getting desired results.Now if i changed the Timegranule( i.e ytd to day or mtd to ytd) for the same day in the calendar ,the calendar object is getting reset.I want to make it as it as until i change the date .

.

Thanks

Anonymous
Not applicable
Author