Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
robert_mika
Master III
Master III

Try

Script:

Directory;

LOAD Date(terc) as monthterc,

     [Defect Category]

FROM....

Expression:

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

View solution in original post

27 Replies
Anonymous
Not applicable
Author

Hi,

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

KR

Elena

maxgro
MVP
MVP

here a possible answer

Relative Calendar Fields

robert_mika
Master III
Master III

Not applicable
Author

Thanq all ,

Hi Elena

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

Thanks in advance.

robert_mika
Master III
Master III

Could you post small sample of your data?

robert_mika
Master III
Master III

Try this:

chart.jpg

Directory;

LOAD terc_defect,

     monthterc,

     Value

FROM

[151270.xlsx]

(ooxml, embedded labels, table is tab1);

Not applicable
Author

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
Author


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

robert_mika
Master III
Master III

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.