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.

Not applicable

URGENT HELP!!!

Field Name

Value

SERIAL NUMBER

Example - A12B34

Contract Flag

This field will have potentially 3 values

C – Under contract based on Contract Start Date and Contract End Date

N – No contract based on the same dates

P – Used to have contracts but does not have any contracts now

For example, the serial number A12B34, has a contract number 0012345678 , which has validity of 04/12/12 to 04/11/13, in this case, the flag will have P as this serial number does not have a contract right now but it used to have in the past.

I got 'C and 'N' but unable to get the 'P'...How to achieve it....Thanks in advance!!!

1 Solution

Accepted Solutions
juleshartley
Not applicable

Re: URGENT HELP!!!

This should just be down to the ordering in your conditional clause-

=If([Contract End D]= [Contract Start],'N',(

     If([Contract End D]<Today(),'P',(

     'C')))

16 Replies
manojkulkarni
Not applicable

Re: URGENT HELP!!!

didn't understand the problem, could elaborate the problem..

juleshartley
Not applicable

Re: URGENT HELP!!!

More detail please...!

Not applicable

Re: URGENT HELP!!!

Output:

Field Name

Value

SERIAL NUMBER

A12B34

Contract Flag

P

My Contract flag shud have the above three values as C,N,P which I need to be created.

For example,

Serial Number     Contract          Start Date        End Date          Contract flag

A12B34               12345           04/23/2012       04/23/2013               P

B12D34               54321           04/23/2012       04/23/2014               C

T12B35               22345           04/23/2012       04/23/2012               N

P->displays all  serial numbers ie., A12B34  because it used to have a validity but now it has expired as of today.

C->displays all  serial numbers ie., B12D34  because it  is still valid as of today.

N->displays all  serial numbers ie., T12B35   because it  start date is equal to end date.

Not applicable

Re: URGENT HELP!!!

Reply given

puttemans
Not applicable

Re: URGENT HELP!!!

I'd make your end  date a serial number by 'Num(End Date) as End Date' in the script,

Then you can play around with it:

If((End Date = Start date), N,

     If ((End Date = Today()), C,

          If((End Date < Today()), P))) as Flag

ashwanin
Not applicable

Re: URGENT HELP!!!

I think you need to add values as per your serial id, which must contain P,C, N

You can also get it from Serial number of contract.

if(left([Serial Number],1)='A','P ',if(left([Serial Number],1)='B','C',if(left([NUMBER],1)='T','N')) as Flag

Not applicable

Re: URGENT HELP!!!

Yes, I already tried that before, not getting the value P

Not applicable

Re: URGENT HELP!!!

this is not what i need, johan is nearer to my issue

juleshartley
Not applicable

Re: URGENT HELP!!!

Can you explain why Johan's answer does not work?