Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight table if() statements

Hello all, this is my first post and I am fairly new to QlikView so please bear with me.

I have a set of information illustrated by the table below, I have labelled them A, B & Boolean so hopefully the answer will apply to more people than just my specific case.

Field A

Field BBoolean
A1B11
A1B20
A1B30
A1B41
A2B11
etcetcetc

In my application though, Field A is basically a project number, Field B is a project phase and the boolean is whether or not that phase is complete.

Basically what I need is to be able to say 'If B2 is not complete AND B1 is complete then B2 is due' So that the output would look something like:

Field A

Field BIs it Due
A1B2Due
etcetcetc

I thought something like:

=if(FieldB='B2' AND Boolean = 0, if(FieldA='B1' AND Boolean = 1, 'Due', 'Not Due'))

But I think I'm on completely the wrong track, do I need to load the information differently?

Hopefully this is clear enough, and I'm not asking too stupid a question

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm not sure why you need the aggr(). If you make the dimensions FieldA & FieldB then:

=if(NOT Boolean AND Above(Boolean), 'Due', '')

-ob

View solution in original post

18 Replies
its_anandrjs

Hi,

As i understand might you have looking for this please check code

T:

LOAD * Inline

[

FieldA,FieldB,Boolean

A1, B1, 1

A1, B2, 0

A1, B3, 0

A1, B4, 1

A2, B1, 1

etc, etc, etc

];

load

FieldA,FieldB,Boolean,

if(Boolean = 0,'Due','Not Due') as Flag

Resident T;

DROP Table T;

Hope this helps

Thanks & Regards

Not applicable
Author

Hi Anand,

Thanks a lot for responding,

Not quite, If a project phase is not complete it is not necessarily 'Due' because of dependencies. The important part is that, if the phase before it is complete then it is due so in this example below:

Field A

Field BBoolean
A1B11
A1B20
A1B30
A1B41
A2B11

In project 'A1' phase 'B2' is Due, but 'B3' is not.

its_anandrjs

Hi,

Ok but how you identify the B3 is not Due and what is the use of Boolean field.

Hope this helps

Thanks & Regards

Not applicable
Author

Well exactly, that is what I am asking. Perhaps I was not clear enough. Is there an expression I can write for the given table to add a column saying 'If the row above is complete and this row is not, then it is due'

The boolean says whether a row is complete or not.

Sorry if it is not a very good question

its_anandrjs

Hi,

Yes you are right if any field is created with check the project is completed or not then you are able to display that in application is there any other field.

Hope this helps

Thanks & Regards

Not applicable
Author

I think there has been some mis-communication, thank you for your help anyway

its_anandrjs

Hi,

I think there is some reference field for that.

Hope this helps

Thanks & Regards

PrashantSangle

Hi,

Just Try this in your script,

If(FieldB='B2' AND Boolean=0,'Due') as [Is it Due]

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi Maxdreamer,

Thanks for your response, unfortunately this is not what I am after,

"If a project phase is not complete it is not necessarily 'Due' because of dependencies. The important part is that, if the phase before it is complete then it is due"


It appears what you suggest would just say Due if the Boolean is 0


Regards