Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

hammermill21
Contributor II

6 month trend with a line chart

Hello,

I have a list of Fire Ext. types that pass or fail inspections daily and I want to show the trend from the last 6 months. So I want to be able to select a month of Jan 2017 and show that month and the last 6 months of that type if it passed or failed.

I'm not really sure how to do this.

Thank you!

8 Replies
Not applicable

Re: 6 month trend with a line chart

Hello Elizabeth

Just to understand your question… you want to select a Date (Ex: Jan-2017) and you want the graph to show information from August to January?.. six months back from the date you choose?

Regards

Diego

Not applicable

Re: 6 month trend with a line chart

Another question... are you using Qlik Sense Desktop or Qlik Sense Server?

Regards

Diego

hammermill21
Contributor II

Re: 6 month trend with a line chart

Hey Diego!

Yes, I want to be able to pick the Month and FireX type and get six months back from the date I choose.

And I am using Qlik Sense Server.

brunobertels
Valued Contributor

Re: 6 month trend with a line chart

Hi Elisabeth

regarding your post if you are talking about a six month trend and take as example january 2017 , i guess you have a MonthYear dimension in your chart and a Date field in your data set.

Here i guees you have a field called TEST with possible value 'Pass' and 'Fail'

So to count the last six month number of test Pass :

Count({$<TEST={'Pass'},Date=({$<={">=$(=Addmonth(Max(Date),-5))<=$(=Max(Date))"}>}Date)>}TEST)


So to count the last six month number of test Fail :

Count({$<TEST={'Fail'},Date=({$<={">=$(=Addmonth(Max(Date),-5))<=$(=Max(Date))"}>}Date)>}TEST)



hammermill21
Contributor II

Re: 6 month trend with a line chart

Hey Bruno,

Thanks for your reply! It's not working 100% but I'm going to try a few other things to see what happens.

brunobertels
Valued Contributor

Re: 6 month trend with a line chart

Hi

Does it works now ? What was wrong ?

Bruno

hammermill21
Contributor II

Re: 6 month trend with a line chart

Hey Bruno!

Sorry for not getting back to you. I worked around it because that was not working, I'm making a few changes in the script which I think was affecting my calculations.

Thank you so much for your help though!!

amuratbar
New Contributor III

Re: 6 month trend with a line chart

Maybe it is helpfull;

=Count({<Year=,[Year Month]=,Month=,Date={">$(=MonthEnd(AddMonths(Date(Max(Date)),-6)))<=$(=MonthEnd(Max(Date)))"}>} Test)