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

27 Replies
robert_mika
Master III
Master III

=avg({<Montterc={'>$(=monthStart(max(Montterc),-2))'} ,[Enterprise system]= >}days_open)

Script:

LOAD days_open,

  [Enterprise system],

  date(Montterc) as Montterc

FROM

[151270.xlsx]

(ooxml, embedded labels, table is tab1);

Not applicable
Author

i am not getting the last 3 months , infact if you can see in the image i am getting all months .

i see my expression is sum(days_open)/count(enterprise system)Capture1.PNG

Capture2.PNG

capture3.PNG

capture4.PNG

the 4th image is sample data . for jan file . the same way i have all 12 months data .

Not applicable
Author

hey sorry it is coming . since i have to give  field name date(dottp1p2_month) as datedottp1p2 in set analysis

but when i give set analysis expression , i am getting only 2 months . jan and dec months

Capture1.PNG

Capture2.PNGcapture3.PNG

robert_mika
Master III
Master III

In expression change 2 to 3?

Does it work  now?

If yes could you mark the replay as Correct/Helpful

Not applicable
Author

yes it is working when i change from 2 to 3 , but i wonder why.

i have another question . it is related to same data .can i ask here ?

how to add 2 conditions in set analysis ?

for suppose i am filtering records in a column , they are two values . fixed and not fixed . i am flitering not fixed count using set analysis and now i should also restrict month values in that expression?

Not applicable
Author

i have already marked it has correct answer ,so sorting on average i could just give like

now last question is , i am sending you screenshots

Capture1.PNGCapture2.PNG

capture3.PNG

the last image i am using expression to filter "not fixed first time" , but i also need to filter last 3 months in this expression now.

thanks in advance

robert_mika
Master III
Master III

Sorry I can not help on that..

I have seen you have posted another question on that topic..

Good luck

Not applicable
Author

no worries thanx for the help though