Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

Not applicable

Last 3 months data in expression for a bar chart

Hi all ,

i have 12 months of data , in which i would like to use last 3 months of data while displaying in bar chart.

for suppose i have feb 2014 to jan 2015 data , my last 3 months data should be jan 2015, dec 2014, Nov 2014

my dimensions are 
terc_defect

monthterc

i need an expression to take last 3 months data

Thanks in advance

1 Solution

Accepted Solutions

Re: Last 3 months data in expression for a bar chart

Try

Script:

Directory;

LOAD Date(terc) as monthterc,

     [Defect Category]

FROM....

Expression:

count({<monthterc={'>$(=monthstart(max(monthterc),-2))'}>}[Defect Category])

27 Replies
elena888
Valued Contributor

Re: Last 3 months data in expression for a bar chart

Hi,

you can use Addmonths( max(date), 0), Addmonths( max(date), -1), Addmonths( max(date), -2) in your set analysis

KR

Elena

MVP
MVP

Re: Last 3 months data in expression for a bar chart

here a possible answer

Relative Calendar Fields

Re: Last 3 months data in expression for a bar chart

Not applicable

Re: Last 3 months data in expression for a bar chart

Thanq all ,

Hi Elena

  could you help me writing the set analysis , i have two dimensions Monthterc and terc_defectcategory.

Thanks in advance.

Re: Last 3 months data in expression for a bar chart

Could you post small sample of your data?

Re: Last 3 months data in expression for a bar chart

Try this:

chart.jpg

Directory;

LOAD terc_defect,

     monthterc,

     Value

FROM

[151270.xlsx]

(ooxml, embedded labels, table is tab1);

Not applicable

Re: Last 3 months data in expression for a bar chart

tercDefect Category
10/17/2014 0:00Application Configuration
10/16/2014 0:00Requirements
10/28/2014 0:00Application Configuration
10/28/2014 0:00Application Configuration
10/27/2014 0:00Application Configuration
10/31/2014 0:00Code
10/28/2014 0:00Code
10/16/2014 0:00Application Configuration
10/16/2014 0:00Environment - Third Party
10/16/2014 0:00Application Configuration
10/16/2014 0:00Application Configuration
10/20/2014 0:00Application Configuration
10/20/2014 0:00Application Configuration
10/7/2014 0:00Environment
10/10/2014 0:00Code
10/8/2014 0:00Tester Error
10/9/2014 0:00Low Level Design
10/2/2014 0:00High Level Design
10/17/2014 0:00High Level Design
10/1/2014 0:00Low Level Design
10/8/2014 0:00Code
10/9/2014 0:00Code
10/3/2014 0:00Code
10/9/2014 0:00Code
10/9/2014 0:00Code
10/17/2014 0:00Code
10/29/2014 0:00Application Configuration

i gave  month(terc)  as monthterc

so my dimensions are monthterc and [ terc_defect category]

Not applicable

Re: Last 3 months data in expression for a bar chart


this is for october month data , the same way i have nov and december and also january data in another excel sheets .

Re: Last 3 months data in expression for a bar chart

What do you want to achieve on the bar?

Count the category?

Unless you have got large amount of your data it would be good practise to put them all in one sheet.

Community Browser