Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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.

maternmi
Not applicable

dynamic date

Hello,

I would like to generate a dynamic date in the script (for short period is it a fix date) for all orders (ID), which I can compare with a delivery date. At the end I would like to show all orders in the chart with a delivery date before the dynamic date and hide all order in the chart after the dynamic date --> if(dynamic date >= delivery date, delivery date, 'not relevant')

As dynamic date I would like to have the first MonthYear (e.g. 04.2015 or 07.2015 or 10.2015 or 01.2016....) of each quarter but always the smallest one. For example the next smallest dynamic MonthYear is 04.2015 and as soon as we reached 04.2015, then it switched to the next 07.2015 and so on...

How can I do it? Below you can see what I mean.

Order no.Delivery DateDelivery MonthYearDynamic MonthYear
0001114992\00100029.01.201501 201504 2015
0001114511\00100016.02.201502 201504 2015
0001115038\00100010.04.201504 201504 2015
0001115485\00100012.05.201505 201504 2015
0001115469\00100003.07.201507 201504 2015

BR

Michael

1 Solution

Accepted Solutions
maternmi
Not applicable

Re: dynamic date

Hi Andrei,

finally you helped me with your answer. I only add one "shift" paremeter (=1) more with result it shows me the first month of the following quarrter.)

LOAD

...

date(QuarterStart(today(),1),'MM.YYYY') as [Dynamic Month Year]

FROM datasource;

Thanks!

BR

4 Replies
crusader_
Not applicable

Re: dynamic date

Hi,

Use below expression in script

LOAD

...

date(QuarterStart(today()),'MM.YYYY') as [Dynamic Month Year]

FROM datasource;

Hope this helps.

Regards,

Andrei Kaliahin

maternmi
Not applicable

Re: dynamic date

Hi Andrei,

I can try it but I expect as result the current MonthYear = 01.2015, but I always need the next one and from today view it is 04.2015.

What do you mean?

maternmi
Not applicable

Re: dynamic date

Hi Andrei,

As expected the result is 01 2015. Do you or somebody else have any other idea?

BR

Michael

maternmi
Not applicable

Re: dynamic date

Hi Andrei,

finally you helped me with your answer. I only add one "shift" paremeter (=1) more with result it shows me the first month of the following quarrter.)

LOAD

...

date(QuarterStart(today(),1),'MM.YYYY') as [Dynamic Month Year]

FROM datasource;

Thanks!

BR