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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_321988

Bar chart to show only 12 months rolling

Hi team,

 

attached  is my sample data which have  fact and master calendar  and below  is my script and chart expression

Fact:
LOAD
Measurefield,
date(floor(num(Date))) as Date,
Fact_flag
FROM folder;

Dim_MC:
LOAD
date(floor(num(Date))) as Date,
WEEK(Date) AS Week,
YEAR(Date) AS Year,
MONTH(Date) AS Month,
DAY(Date) AS Day,
WEEKDAY(Date) AS Weekday,
'Q'& CEIL (MONTH( Date ) / 3 ) AS Quarter,
DATE(monthstart( Date ), 'MMM-YYYY') AS MonthYear,
WEEK(Date ) & '-'& YEAR (Date ) AS WeekYear

from folder;

 

bar chart dim and exp

dim as month year

exp as below

if(GetSelectedCount(Year)>=1 or GetSelectedCount(Quarter)>=1 or GetSelectedCount(MonthYear)>=1 or GetSelectedCount(Week)>=1 or GetSelectedCount(Date)>=1,

Sum({<Fact_flag={'fact_1'}>}Measurefield),

Sum({<Fact_flag={'fact_1'},
MonthYear = {">=$(=date(MonthStart(AddMonths(Today(), -12)),'MMM-YYYY'))<=$(=date(MonthEnd(AddMonths(Today(), -1)),'MMM-YYYY'))"}>}Measurefield)


)

i want to show the default 12 months rolling in my chart and i don't want to disable the data enabling ->  include zero values, because if there is no data for that month it have show 0 for the month since i am using master calender

now wht is happening in bar chart it shows entire all months here, it have to show only 12 months data as per the if loop section 

 note i dont want to disable the data handling  -->include zero values please help and support on this and also no calculated dim also 

manoranjan_321988_0-1732808755438.png

 

 

 

Labels (3)
22 Replies
manoranjan_321988
Author

sorry for the late reply, my server now got updated and will accept your reply as solution , but opening new thread as below linkw  with different scenario , note : if we multiple use measure we cant use the two dimension in the bar chart , so opening new ticket pls have a follow up and update its different scenario

 

https://community.qlik.com/t5/App-Development/Rolling-6-months-data-as-per-the-time-frame-selection-...

 

 

manoranjan_321988
Author

https://community.qlik.com/t5/App-Development/rolling-6-4-months-in-bar-pivot-table-with-multiple-or...

 

i reopened new thread for new scenario pls help and support on this