Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

aun tengo problema con crear un rango de fecha

quiero crear un rango de fecha que inicio el 01/01/2010 y el fin se la fecha actual quiero meter todos los dias de ese rango en un solo campo, por favor algo mas simple de entender gracias

1 Solution

Accepted Solutions
SunilChauhan
Champion II
Champion II

load this code in application

set vMindate='01/01/2010';

set vMaxdate=date(today());

tempCal:

Load

$(vMindate)+iterno()-1 as tempdate,

date($(vMindate)+iterno()-1) as Date,

Monthname($(vMindate)+iterno()-1) as MonthYear

autogenerate 1  while $(vMindate)+iterno()-1<=$(vMaxdate);

and then take Date and see

is this what you required

hope this helps

Sunil Chauhan

View solution in original post

7 Replies
SunilChauhan
Champion II
Champion II

load this code in application

set vMindate='01/01/2010';

set vMaxdate=date(today());

tempCal:

Load

$(vMindate)+iterno()-1 as tempdate,

date($(vMindate)+iterno()-1) as Date,

Monthname($(vMindate)+iterno()-1) as MonthYear

autogenerate 1  while $(vMindate)+iterno()-1<=$(vMaxdate);

and then take Date and see

is this what you required

hope this helps

Sunil Chauhan
Not applicable
Author

como funciona y que hace ese autogenerate 1 ?

Not applicable
Author

I have a friend problem I do what I explicastes but in my field only leaves a date of '29 / 12/1899 'I do not get the date range

SunilChauhan
Champion II
Champion II

it will start from

01/01/2010 and  iterate  till today

autogenrate 1 mean  it will genrate 1 value for each iteration

and it will iterate till less than or equal to  maxdate i.e today.

hope this helps

Sunil Chauhan
Not applicable
Author

thank you friend

Not applicable
Author

Estimado,

Aségurate que el formato de tu fecha sea el mismo que el declarado en la variable.

Yo le agregué el valor 42189 para que comenzara en el 01-01-2010 y no en el 1894...

Al menos así me funcionó a mí.... la función autogenerate junto con la while son para iterar n veces hasta que se cumpla la condición... sólo le suma 1 día  (iterno()) a la fecha por cada iteración para que genere todos los rangos de fechas que necesitas. En este caso desde el 01-01-2010 a la fecha actual.

Prueba y me cuentas si no te funciona.

SET DateFormat='DD-MM-YYYY';

set vMindate='01-01-2010';

set vMaxdate=date(today());

tempCal:

Load

$(vMindate)+42189+iterno()-1 as tempdate,

date($(vMindate)+42189+iterno()-1) as Date,

Monthname($(vMindate)+42189+iterno()-1) as MonthYear

autogenerate 1  while $(vMindate)+42189+iterno()-1<=$(vMaxdate);

Not applicable
Author

gracias por apoyarme pero tamibne vi eso y puse esto y funciono correcto muchas gracais

set vMindate= ('2010-01-01');