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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
ajaykumar1
Creator III
Creator III

last 13 months data

Hi All,

1.How we can get the last 13 months data with out writing the 13 expressions in chart.

stuck some where to write the variable for 13 months and pass that to set analysis level.The field is 'Month' which is having around 20+ months data.

Thanks,

Ajay

Labels (1)
12 Replies
Not applicable

Hi, you should create a calendar, assigning a progressive id to every month, so that you have a key to identify each month.

then you can just insert

if(Month_ID > Max(Month_ID)-13, Month) as your dimension

ajaykumar1
Creator III
Creator III
Author

Thanks Luca...

let me try the same

ajaykumar1
Creator III
Creator III
Author

Hi its not working.

   load Month,

     sal,

     if(Month>max(Month)-13,Month) as month_derived,

Not applicable

Any one is there  ????

santharubban
Creator III
Creator III

try this, AddMonths(MonthStart(Today()), -14) in dimension of chart.

or

load Month,

     sal,

      month_derived  from xxxx.qvd where date(month_derived)  => AddMonths(MonthStart(Today()), -14) ;

Not applicable

No Luck Santhu.....

santharubban
Creator III
Creator III

what error ur getting?

ajaykumar1
Creator III
Creator III
Author

I am getting only one record.... am trying to attach the qvw but am unable.

Monthsaltype
01/01/12100test
01/02/13101manf
01/03/14102tetst
01/04/15103hvv
01/05/16104vshvv
01/06/17105vvZ
01/07/18106vsv/
01/08/11107sgvugu
01/09/10108vslvhkls
01/10/09a ns;v
01/11/08110vsdhv
01/12/01111sgvugu
01/13/02112svdi
01/14/04113sdv;do
01/15/87114svdiwhp
01/16/86115shvsh;
01/17/85116sv;sv
01/18/80117vsh;v
01/19/12118sbh;bj'
01/20/12119ah;adoh
01/21/12120ab'adj'
Carlos_Reyes
Partner - Specialist
Partner - Specialist

I always use a MonthName field for this type of analysis. Review the attached to see an example.