Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Any insight on how this could be done?

Find the attachment for the excel that i've created for a mock of what is the input and what i am trying to achieve for the output. I have units listed for every month. I would need to create a field called Range which will have column values like 3M forward(which should dynamic and right now this values will consider the next 3 months including present month), 6M forward and on. The calculation for the units will sum(units) but by default this will show the sum(April+may+june months units) which will be a 3M forward. but when i change my value to 6 month forward then the calculation will adjust to april thru sep in this case and this should be dynamic. I couldn't figure out a way to do this. Hope i can find some help on this here?

Thanks in advance.

1 Solution

Accepted Solutions
d_pranskus
Contributor III

Re: Any insight on how this could be done?

Hi Dinesh

I'm not sure is this what you wanted to achieve, but I believe it could be achieved using set analysis. Please have a look at sample attached.

Cheers

Darius

9 Replies
Not applicable

Re: Any insight of how this could be done?

Easiest way, if first month is satic will be load data like this:

table 1:

value, month

1,1

2,1

3,1

4,2

2,3

4,4

4,5

5,6

.....

table 2:

range, month

m3, 1

m3,2

m3,3

m6,1

m6,2

m6,3

m6,4

m6,5

m6,6

........

then use range as a dimension.

Let me know if you nedd more help

regards

Darek

Not applicable

Re: Any insight of how this could be done?

Yes, to your opinion it will work if the month is static. But, the need here is  months to be dynamic and i  think this will not work.

Not applicable

Re: Re: Any insight of how this could be done?

i'am not sure, but look for first example

Let me know if you need more ...

jolivares
Valued Contributor

Re: Any insight of how this could be done?

I try to load this field in the script...

Load ...

if(month - 3 <=0,1,0) as 3M, ... and so on.

This create a different fields, because you have that first month is share with all other, so you can't put in one.

Not applicable

Re: Re: Any insight of how this could be done?

next example version for you

you may select start month here ...

Your pick() expression may be build in the load script ....

Not applicable

Re: Any insight on how this could be done?

I think this is little bit similar to what i was looking. But the months should be dynamic like 3M should be in this case starting from present month +2 (April+may+june) same thing with 6M and 9M. Because when we roll into 2015 then you will have 3M( jan thru March), 6M(Jan thru June),9M and 12M but again this future look up.

d_pranskus
Contributor III

Re: Any insight on how this could be done?

Hi Dinesh

I'm not sure is this what you wanted to achieve, but I believe it could be achieved using set analysis. Please have a look at sample attached.

Cheers

Darius

Not applicable

Re: Any insight on how this could be done?

Thanks Darius Pranskus. Explicitly Just what is needed.

Not applicable

Re: Any insight on how this could be done?

Thanks

It is helpful.

Community Browser