Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
i have 13 months of data . i would like to restrict last 3 months of data for a specific graph in the chart and also i have a graph where i have to show last 12 months of data .
i would like to restrict data in to qlikview by using where clause to restrict last 12 months of data and 3 months of data at expression for graphs which require trend analysis for 3 months .
=count({<Monthesvd=, Date={'>=$(=MonthStart(Today(), -2)) <=$(=Today())'}>} [esvd_Enterprise_System])
missed a close bracket..
Check this
hi anbu , could you please post the logic . i dont have a licenced qlikview version yet?
Hi,
For last 3 months
In set Analysis try like
Sum({<Date={">=$(=Date(Addmonths(max(Date),-3)))"}>}Sales)
for last 12 Months
Sum({<Date={">=$(=Date(Addmonths(max(Date),-12)))"}>}Sales)
Regards
Script:
Temp:
Load * Inline [
Year,Month,Sales
2015,2,50
2015,1,100
2014,12,200
2014,11,150
2014,10,100 ];
Final:
Load *,Autonumber(Year+Month) As YrMthNo Resident Temp Order by Year,Month;
Drop table Temp;
Chart:
Dimension: Year,Month
Expr: Sum({<YrMthNo={'$(=Max(YrMthNo))','$(=Max(YrMthNo)-1)','$(=Max(YrMthNo)-2)'}>} Sales)
Hi Aditya,
For restricting last 12 months data use below script
LOAD
*
FROM DataSource
WHERE DateFieldName> MonthStart(Today(), -11) AND DateFieldName <= Today();
In chart to display last 3 months
=Sum({<YearFieldName=, QuarterFieldName=, MonthFieldName=, Date={'>=$(=MonthStart(Today(), -2))<=$(=Today())'}>} Sales)
Hope this helps you.
Regards,
Jagan.
hi jagan,
i am getting last 11 months data but
for using 3 months data i am unable to get it . i am unable to unds
YearFieldName=, QuarterFieldName=, MonthFieldName=,
i only have monthfieldname = monthesd
dimenions = monthesvd
= enteprise system
i am doing expression on count(enterprise system)
and second question is :
i have a problem here
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.
so how to add both conditions in set analysis ,
1. to filter not fixed first time "
2. to restrict them for last 3 months
HI,
Try this for last 3 months
=Sum({<YearFieldName=, QuarterFieldName=, MonthFieldName=, Date={'>=$(=MonthStart(Today(), -2))<=$(=Today())'}>} Sales)
Replace YearFieldName, QuarterFieldName, MonthFieldName fields with your actual Year, Quarter and Month fields.
YearFieldName=, QuarterFieldName=, MonthFieldName= ignores the selections in the Year, Quarter and Month fields, if you do not have any of this fields remove it from the expression. Even if you select one month it always shows last 3 months because we are ignoring the filters.
Use below for Not Fixed First Time and last 3 months
=Sum({<[dfft_Fix Time] = {'Not fixed first time'}, YearFieldName=, QuarterFieldName=, MonthFieldName=, Date={'>=$(=MonthStart(Today(), -2))<=$(=Today())'}>} Sales)
Regards,
Jagan.