Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I want to store some value like Apr-16, May-16...........Aug-17 in array/list & use this values in chart as dimension.
I tried this but not successed.
FOR t = YearStart(Today(),-1,4) to Today()
k = Date(MOnthStart(t),'MMM-YY')
t= AddMonths(t,1)
NEXT t;
Dear Bharat,
can you elaborate little bit more what you are trying to achieve?
if you are trying to store Month-Year in a field you can use master calendar and set the Minimum date and maximum dates in variables.
below is the code:
SET varMinDate=Date(YearStart(Today(),-1,4),'DD/MM/YYYY');
SET varMaxDate=Date(Today(),'DD/MM/YYYY');
TempCalendar:
LOAD
$(varMinDate) + Iterno()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
MasterCalendar:
Load
TempDate AS OrderDate,
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day(TempDate) As Day,
date(monthstart(TempDate), 'MMM-YY') as MonthYear
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;
Thanks,
Mukram.
Why you need only Apr-16 ... Aug-17 ?? Is there any logic?
May be this in script and use it dimension as this?
If(Match(FieldName, 'Apr-16', 'May-16', ......, 'Aug-17'), FieldName) as FieldName_Copy
Dear Bharat,
can you elaborate little bit more what you are trying to achieve?
if you are trying to store Month-Year in a field you can use master calendar and set the Minimum date and maximum dates in variables.
below is the code:
SET varMinDate=Date(YearStart(Today(),-1,4),'DD/MM/YYYY');
SET varMaxDate=Date(Today(),'DD/MM/YYYY');
TempCalendar:
LOAD
$(varMinDate) + Iterno()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
MasterCalendar:
Load
TempDate AS OrderDate,
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day(TempDate) As Day,
date(monthstart(TempDate), 'MMM-YY') as MonthYear
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;
Thanks,
Mukram.
@Anil Babu Samineni & @Mohammed Mukram
I have two dates Active customer date & Deactivate customer date, for the date range Apr-16 to Aug-17.
I have to show the count for both. But in Chart i can only take 1 date in dimension & Expression count of the respective conditions.
So I was thinking to generate a list of Dates (Apr-16 to Aug-17) as X- axis and 2 Y-axis showing count of each state by 2 different dates.