Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

set analysis with date variables

hello everybody,

someone could help me i met an problem with date variable..

I try to put tow date  in an set analysis  but it doesn t work :

  • vYDMIN :  Date(Yearstart(max(%date)),'DD/MM/YYYY') 
  • vYDMIN  :   Date(Max( %date),'DD/MM/YYYY')  

%date is my key calendar ...

This is  my expression  :

sum({$ <%date={">=$(#vYDMIN)<=$(#=vYDMAX)"} >} [Indic.])

Do you know where is problem , i try a lot of solution but all doesn t work

Thank for your help

1 Solution

Accepted Solutions
MVP
MVP

Re: set analysis with date variables

Put '=' sign while defining variable.

15 Replies
hrlinder
Honored Contributor

Re: set analysis with date variables

did you try $(=vYDMIN) instead of $(#vYDMIN) and also with VYDMAX

another point:

why do you format the variable and in the set expression you assign to origin again.

Is there a difference in the format?

how does %date looks like in format?

Re: set analysis with date variables

Try this:

sum({$ <%date={">=$(vYDMIN)<=$(vYDMAX)"} >} [Indic.])

whereat %date needs to formatted like the variables in 'DD/MM/YYYY'. Less error-prone is by calculations with dates and times is to use numeric values with num(%date).

- Marcus

marcarreras
Valued Contributor

Re: set analysis with date variables

Pierre,

Try this:

sum({$ <%date={">=$(=$(vYDMIN))<=$(=$(vYDMAX))"} >} [Indic.])


Marc.

Not applicable

Re: set analysis with date variables

thanks for all answers,

i  ve tried 

sum({$ <%date={">=$(vYDMIN)<=$(vYDMAX)"} >} [Indic.]) this give 0

sum({$ <%date={">=$(=$(vYDMIN))<=$(=$(vYDMAX))"} >} [Indic.])  it doesn't work, this syntax give me no result


All the data are in good format 'DD/MM/YYYY'  and the variable in text object give the rigth date :


$(vYDMIN)=01/01/2014

$(vYDMAX)=16/09/2014





hrlinder
Honored Contributor

Re: set analysis with date variables

try once:

sum({$<%date={'>=$(=vYDMIN)<=$(=vYDMAX)'}>} [Indic]

Not applicable

Re: set analysis with date variables

Thank again i ve try but the result is again 0.

Nobody has nay idea about the origin of the problem, i m  desperate ..Smiley Wink

hrlinder
Honored Contributor

Re: set analysis with date variables

what should be the result?

please define a listbox with %date and select all dates between 1/1/2014 and 16/9/2014

create a textbox with sum([Indic])

what is the result?

anbu1984
Honored Contributor III

Re: set analysis with date variables

Can you post sample app.

MVP
MVP

Re: set analysis with date variables

Better idea would be - create a qvw with sample data that demonstrates the issue and share. I am sure that you would get faster resolution.

Community Browser