Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have chart which shows forthcoming maintenance tasks:
however rather than showing all months we only want to show data from the previous month onwards.
So in this scenario I only want to see in the bar chart data from Aug-2015 onwards.
I've played about the variables and the expression but not cracked this yet!
the chart dimension is "MonthYear"
the expression is : =count(DISTINCT {<probtype_cat={'PPM'}>} [Work Request Code])
I've variables for current month & current year i.e. "let vCurrentMonth = month(today())" & "let vCurrentYear = year(today())"
HI Dan,
Maybe try something like the below:
count(DISTINCT {<probtype_cat={'PPM'}, MonthYear = {">=$(Date(Today(), 'MMM-YYYY'))"}>} [Work Request Code])
Edit: Sorry, you said previous month and on so try the below:
count(DISTINCT {<probtype_cat={'PPM'}, MonthYear = {">=$(AddMonths(Date(Today(), 'MMM-YYYY'), -1))"}>} [Work Request Code])
Hope this helps.
try
count(DISTINCT {<probtype_cat={'PPM'}, MonthYear = {">=$(Date(AddMonths(Today(), -1),'MMM-YYYY'))"}>} [Work Request Code])
SasiParupudi1 got it right...
Sorry still does come up right, it shows all months of the year not from last month onwards:
expression is: =Count(DISTINCT {<probtype_cat={'PPM'}, MonthYearToPerform={">=$(Date(AddMonths(Today(),-1),'MMM-YYYY'))"}>} [Work Request Code])
Is your MonthYearToPerform dimension formatted as text or date? Would you mind posting some sample data?
Hi,
Please try using calculated dimension for the MonthYear instead of MonthYear.
if(MonthYear >= (Date(AddMonths(Today(),-1),'MMM-YYYY')), MonthYear, Null())
Hope this help.
Regards,
Vivek Singh
we use a QVD loader file, which includes generic date/calendar scripts for various date fields from our source application, for MonthYearToPerform it uses as follows:
// Generate Final Calendar
LOAD
[$(_field)]
,year([$(_field)]) as [Year$(_prefix)]
,month([$(_field)]) as [Month$(_prefix)]
,day([$(_field)]) as [Day$(_prefix)]
,weekday([$(_field)]) as [WeekDay$(_prefix)]
,Date(MonthStart([$(_field)]),'MMM-YYYY') as [MonthYear$(_prefix)]