13 Replies Latest reply: Jun 9, 2014 3:38 PM by Preethi Ashwin

# time interval

Hello to all

I have a date dimension to calculate the performance of a KPI (calculation expression)

if I select a month now I have the value of the KPI for the selected month, while I would get a performance of the value of the KPI YTD month selected.

For example, if I select in April now I have a graph with a single value (KPI April) while I would get a trend with the KPIs of January, February, March and April)

I think I should use's set-analisys.

thanks

Andrea

• ###### Re: time interval

Hello, thanks for your kind reply.

I read the guide but there is talk of division for the quarter, while in my case the value is dynamic rolling according to the selected month

I do not have to do the sums, I have a line chart with the trend dell'esperessione in the selected period.

For example, if I selected the month of April, I have 4 points if I selected October 10 points etc ...

Thanks for your cooperation

Andrea

• ###### Re: time interval

If you find the above link too good for your requirement, try to share a sample qvw.

• ###### Re: time interval

YTD calculation in QlikView - Simple Example needed..

Check this thread^^

You can use set analysis to accomplish what you need. If you share your qvw that woudl help.

• ###### Re: Re: time interval

Enclosed I send you a sample

if no date is not selected visualize the temporal trend of the indicator in the year

if I select a period visualize a point.

I would rather see the performance year to date period selected.

thanks

Andrea

• ###### Re: Re: Re: time interval

Please check the attached. Use =Only({\$<DATA={'<=\$(=GetFieldSelections(DATA))'}>}INDICATORE) i the expression.

Please let me know if this is what you want.

• ###### Re: Re: Re: Re: time interval

Hello

sorry if I answer only now

I thank you for the example is exactly what I want to do.

only one thing.

my selection date I have only the month, and the month that if I refer to several years, the view of the data in the graph goes wrong.

I send you enclosed an example.

thanks

Andrea

• ###### Re: time interval

Try this expression: =Only({\$<DataAnnoMese={'<=\$(=Max(DataAnnoMese))'}>}M1)

• ###### Re: Re: time interval
I tried now I'm not going wrong but there is something wrong if you select the months in common (eg february march)

attached what I get.

thanks

Andrea

• ###### Re: time interval

That is because of only(). Use some aggregation function like sum() instead.

• ###### Re: Re: time interval

I tried using the SUM aggregate function but I still have anomalous behavior in the selection of months in common (January, February and March)

thank you

Andrea

• ###### Re: Re: time interval

It is not worig. I dont understand what you are trying to do.

It is doing what it is supposed to do, For example when you select Feb - you are not really selecting the year, so by the above function it is taking the max which is Feb 2014 - We have data for Jan 2014 which is less than feb 2014 and march 2013 which is less than feb 2014 and also feb 2012 and feb 2013 which are less than feb 2014. That is why you are seeing the values for jan , feb and march.

Can you please explain me what you are expecting to see when you select feb using your dataset , so i can understand what yu are trying to do better?