Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
spividori
Specialist
Specialist

Generate dates

Hello.
Have a table containing customer and the first month they made ​​movements. I need to generate from the date of each client the following months until now.
Example with the client that has number 1:

Cli  First movement:

1    01.01.2012

Generate:

1     01.02.2012

1     01.03.2012

1     01.04.2012

1     01.05.2012

1     01.06.2012

1     01.07.2012

1     01.08.2012

1     01.09.2012

1     01.10.2012


and so with all customers.

Regards.

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Check with this,

Datos:

LOAD Cli, Date#(Fec,'DD.MM.YYYY') AS Fec INLINE [

    Cli, Fec

    1, 01.01.2012

    2, 01.12.2011

    3, 01.03.2012

    4, 01.05.2011

    5, 01.07.2012

];

LOAD

  Cli,

  MonthStart(Fec,IterNo()-1) AS CustomerMovementDate

Resident

Datos

While MonthStart(Num(Fec),IterNo()-1)<=MonthStart(today());

View solution in original post

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Check with this,

Datos:

LOAD Cli, Date#(Fec,'DD.MM.YYYY') AS Fec INLINE [

    Cli, Fec

    1, 01.01.2012

    2, 01.12.2011

    3, 01.03.2012

    4, 01.05.2011

    5, 01.07.2012

];

LOAD

  Cli,

  MonthStart(Fec,IterNo()-1) AS CustomerMovementDate

Resident

Datos

While MonthStart(Num(Fec),IterNo()-1)<=MonthStart(today());

spividori
Specialist
Specialist
Author

Hi!

This is perfect. Thank you very much.

Regards.