Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

kunkumnaveen
Valued Contributor

sum of Date Range

Hello All,

i am bit confuse and surprise that if i am able to get two diff value (min and max) separately ,y not i am getting them when i merge them ...

what i mean is

Varibles:

vMindate= 3 sep

vMaxdate=  =Date(Max({Group2}Date),'DD MMM')

i am getting value for the below two expression:

1)textbox=

=Num(sum({<Date={"$(vMindate)"},diss={10}, work={0}>} value)/

sum({<Date={"$(vMindate)"},diss={10}>} value),'##0%')


2)textbox=

=Num(sum({<Date={"$(vMaxdate)"},diss={10}, work={0}>} value)/

sum({<Date={"$(vMaxdate)"},diss={10}>} value),'##0%')

but when i tried to merge them like below exp

3)textbox=

=Num(sum({<Date={">=$(vMindate)<=$(vMaxdate)"},diss={10}, work={0}>} value)/

sum({<Date={">=$(vMindate)<=$(vMaxdate)"},diss={10}>} value),'##0%')

i am getting   -    as o/p

my date format is like this : 

date

3 jan

4 jan

.

.

.

10 jan

11 jan

.

.

some one earlier said that by date is in text format,is that the issues,if so can anyone help me how to resolve this plz

3 Replies
MVP
MVP

Re: sum of Date Range

>>sum({<Date={"$(vMaxdate)"},....

This expression will expect Date to also have the format 'DD MMM', and both [Date] and the variables must be numerical date values, not text, for the range comparison to work correctly. I assume that DD MMM is not the default date format for you system.

vMaxDate should be a date value, but vMinDate will be a text value. Rather define it like this:

Let vMindate = Date(Date#('3 sep' & Year(Today()), 'DD MMMyyyy'), 'DD MMM');

and make sure that Date is a numeric date value.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
kunkumnaveen
Valued Contributor

Re: sum of Date Range

can i use this for

vMindate =Date(Min({Group2}Date),'D MMM') (probelm with this exp is,suppose  if i select 16 sep then it is showing 16 sep as min value which is suppose to be 3 jan)

i am getting Null as o/p when i use ur exp in textbox

Date(Date#('3 sep' & Year(Today()), 'DD MMMyyyy'), 'DD MMM');


Highlighted
kunkumnaveen
Valued Contributor

Re: sum of Date Range

can i use this for

vMindate =Date(Min({Group2}Date),'D MMM') (probelm with this exp is,suppose  if i select 16 jan then it is showing 16 jan as min value which is suppose to be 3 jan)

i am getting Null as o/p when i use ur exp in textbox

Date(Date#('3 sep' & Year(Today()), 'DD MMMyyyy'), 'DD MMM');