15 Replies Latest reply: Oct 7, 2014 12:58 AM by jagan mohan rao appala

# Date range in Set Analysis

Hi All,

I have here a table:

I need to create an analysis, what is the total Qty of the Report Date with the specific date range.

ex: For Report date 20-Sep-14, the range is >=14-SEp-14<=20-Sep-14

How can I include this in my set analysis?

Thanks!

• ###### Re: Date range in Set Analysis

=Sum({<Report_Date={'>=\$(=Max(DayStart)<=\$(=Max(DayEnd)'}>}Qty)

Make sure Report_Date and Max(DayStart) are in same format

• ###### Re: Date range in Set Analysis

yes, but that will only get the maximum dayend and daystart. i need to get per row

• ###### Re: Date range in Set Analysis

Do you have that range in a variable or you calculate it?

• ###### Re: Date range in Set Analysis

It is calculated. Report Date - 6 days

• ###### Re: Date range in Set Analysis

Then try like this

=Sum({<Report_Date={'>=\$(=date(Max(DayStart)-6))<=\$(=Max(DayEnd))'}>}Qty)

Regards

ASHFAQ

• ###### Re: Date range in Set Analysis

Hi doing this will only take the maximum of all..

so max(daystart) will not compute per row but will compute the total.. so max(daystart) in that set analysis will output = 19-sep-14

• ###### Re: Date range in Set Analysis

Hi,

then try your expression with if clause

Regards

• ###### Re: Date range in Set Analysis

=Sum(If(Num(Report_Date) >= (Report_Date-6) And Report_Date<=Report_Date,Qty))

• ###### Re: Date range in Set Analysis

Hi Lyn,

Do have a field which have Dtae=14 Sep 2014 and a Quentity associated with it?

Over gere i guess max(start date) is a calculated field.

Regards

KC

• ###### Re: Date range in Set Analysis

Hi, Report date is associated with the Qty. Yes, for example I have to find the quantity between the dates given above.

If report date is 20-Sep-14 then the date range should be from what is above.

• ###### Re: Date range in Set Analysis

I have attached a sample qvw below

• ###### Re: Date range in Set Analysis

here's a sample document you guys can check out

• ###### Re: Date range in Set Analysis

bump

• ###### Re: Date range in Set Analysis

Hi,

Qlikview calculations are done at table level not by row level, so it is not possible in front end, if you just want for one day then use below expression

=Sum({<Report_Date={'>=\$(=date(Max([Rpt Date])-6))<=\$(=Date(Max([Rpt Date])))'}>}Qty)

if you want for all the days then you have pre calculate in script by using Peek or Previous().

Hope this helps you.

Regards,

Jagan.