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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to show only last 6 months date.

Hi,

I want to show the only last 6 months date in the chart .

Is it possible.

How to filer the date in the chart .

services.png

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

if you take a look at the script you will see that i generated a mastercalendar

and some variables eg.vZeitraum6Monate and vAktuellerMonat.

the mastercalendar is generating a field called ''MonthDiff''. This Field actually assigns

a number to every month. For todays month it should assign the 0 and last month should assign the -1 and for the month before last month it should assign -2 and so on.

vAktuellerMonat (=vActualMonth)  <---   =0

vZeitraum6Monate (=vRange6Month)   <----  =-5

Because i connected the MC to your DataTable you can now define the ranges with setanalysis in order to get the wished data.

In my app which i uploaded there is a small mistake. In the script

on MC sheet on top you will have to replace

SET vAktuellerMonat = -1;  

to:

SET vAktuellerMonat = 0;


hope this helps

View solution in original post

15 Replies
Frank_Hartmann
Master II
Master II

Please upload a small sample qvw.

without knowing your datamodel and fields it might be difficult to assist!

Anonymous
Not applicable
Author

Hi,

If you are looking for only last 6 month data then you can apply filter in script on From part else you can create on dimension with flag like if its last 6 month then true else false.

You can use following in script..

SET MonthDiff = Num(((year($2) * 12) + month($2)) - (((year($1) * 12) + month($1))) + 1);


Load

if(($(MonthDiff(StartDate, EndDate))<=6,'True','False' AS SixMonthsDifference

From...


Thanks,

Pooja singh

Anonymous
Not applicable
Author

2 minutes I am preparing the sample.

Frank_Hartmann
Master II
Master II

no hurry 🙂

Anonymous
Not applicable
Author

why i cant able to attach qvw

it is not showingi the option

Frank_Hartmann
Master II
Master II

You are watching this thread through your inbox? if yes, then try doing it by this link:

How to show only last 6 months date.

Anonymous
Not applicable
Author

Ok

thanks.

My requirement is to show 2 charts

One Line chart having time on x axis for the last 6 months (sep to march) that should show Chrome,IE and firefox

Other line chart having time on xaxis for the last 6 months (sep to march) that should show only IE. versions in our example i didnt create many so thats fine .

I will incorporate the same logic if you can help me pls.

german24
Partner - Contributor III
Partner - Contributor III

Hi,

try this... for e.g.

SUM(

{$<

FactTable.Date = {">=$(=MonthStart(Min(Time.Date),-6)) <=$(=MonthEnd(Max(Time.Date)))"}

>}

FactTable.Amount)

Best regards,

German

Frank_Hartmann
Master II
Master II

Please give more information about the logic behind this requirement!

also there is no information about the year in your app!

What should be shown in the linechart? a count of B?