Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Year,Month and Quater filters not reflected in Graphs

Hi All,

The Below code has been currently using in my .qvw file and i have data in year from 2011 to 2014.

LOAD DISTINCT
Date as BG_DETECTION_DATE,Date,
Year(Date) as Year,
Month(Date) as Month,
Date(MonthStart(Date), 'MMMYY') as MonthYear,
if(monthstart(Date) <= $(vTodaysDate), 1, 0) as _History,
'Q' &
Ceil(Month(Date)/3) as Quarter,
Dual('Q' & Ceil(Month(Date)/3) & '-' & Year(Date), Year(Date) & Ceil(Month(Date)/3)) as QtrYear,
Week(Date) as Week,
Weekstart(Date) as Weekstart,
Weekend(Date) as Weekend
;
Load
Date($(vEndDate) - RecNo() +1) as Date
AutoGenerate($(NumberOfDays));

If i'm selecting Year ,Month, Quarter, its not filtered in my graphs even i added year column in Date as BG_DETECTION_DATE in Load.

What is wrong in my file?

How can i filter with the Year , Month and Quarter in my graphs?

Thanks in advance,

1 Solution

Accepted Solutions
Gysbert_Wassenaar

vEndDate value is : 41918.999999988

That's why your dates have time fractions:

comm155973.png

That's why they don't match with your  table.


talk is cheap, supply exceeds demand

View solution in original post

13 Replies
Gysbert_Wassenaar

Make sure that BG_DETECTION_DATE contains only date values, not timestamp values, i.e. a date + a time fraction. Perhaps you need to split your BG_DETECTION_DATE field into a date and a time field:

LOAD

    Floor(BG_DETECTION_DATE) as BG_DETECTION_DATE,

    Frac(BG_DETECTION_DATE) as BG_DETECTION_TIME,

    ...other fields

FROM ....


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

No, I've data in BG_DETECTION_DATE column like "2012-04-25" ,"2013-07-29"

Not applicable
Author

Hi Prakash,

I think put like this Date as BG_DETECTION_DATEinstead of   Date as BG_DETECTION_DATE,Date,

Gysbert_Wassenaar

Make sure those values are date values and not text values. You can use the date# function to turn text values into dates: date#(BG_DETECTION_DATE, 'YYYY-MM-DD') as BG_DETECTION_DATE.

And check that $(vEndDate) has a value.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

I tried but not yet working:(

Anonymous
Not applicable
Author

vStartDate value is : 42040 and vEndDate value is : 41918.999999988


Not applicable
Author

Hi,

could you send your sample qvw.

mightyqlikers
Creator III
Creator III

Hi

try  below snippet

date(floor(datefield),'DD-MM-YYYY')

Regards

Samwise

Anonymous
Not applicable
Author

Hi,

I've attached my sample .qvw file with few graph, In that graphs we have date columns and  normal filter is working. But am  trying to use Year, Month and Quarter, Filters not applied with the graphs.