Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Store value in list & use them in Chart

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;

1 Solution

Accepted Solutions
Highlighted
Specialist III
Specialist III

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.

View solution in original post

3 Replies
Highlighted

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Specialist III
Specialist III

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.

View solution in original post

Highlighted
Contributor II
Contributor II

@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.