Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

chandu441
Contributor

Conditional field from backend which depends upon the value of record no 1 and record no 2 values...

Hi QV Guys,

I have to create one conditional field which depends on row values in backend script.Capture.JPG

condition: (for the field which is generating with respective of existing fields)

IF (1st record Days<>'NA' and 2nd Record Days <>'NA'),'Backlog','0')

Here Case Number should be same while checking the 1st record and 2nd record..

Attached is the sample data table..

1 Solution

Accepted Solutions
chandu441
Contributor

Re: Conditional field from backend which depends upon the value of record no 1 and record no 2 values...

Hi All,

Here is the resolution which is success.

NoConcatenate

FINAL_DATA:

LOAD

*,

IF([Opened Date]>Finish OR [Closed Date]<[Start],'NA',

IF([Closed Date]<Finish,[Closed Date]-[Opened Date],

IF([Closed Date]>Finish,Finish-[Opened Date]

,'NA'))) AS DAYS,

'FW'&' '&FW&'-'&Right(YEAR_YYYY,2) AS Week_Year

Resident SFDC

Order by [Case Number],Start_Num desc,;

DROP Table SFDC;

Final:

Load *,

IF ( ( [Case Number] = Previous([Case Number]) ) AND (DAYS<>'NA' and Previous(DAYS)<>'NA') ,'Backlog','Null') as BL

Resident FINAL_DATA;

DROP Table FINAL_DATA;

5 Replies
Highlighted

Re: Conditional field from backend which depends upon the value of record no 1 and record no 2 values...

Can you create some thing like this after environment

Set Nullinterpret = '%';

NullasValue DAYS;

Set NullValue = 'Backlog';

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
ahaahaaha
Honored Contributor

Re: Conditional field from backend which depends upon the value of record no 1 and record no 2 values...

Hi,

May be like this

IF (1st record Days<>'NA' and 2nd Record Days <>'NA' and [Case Number] = Above([Case Number]),'Backlog','0')

chandu441
Contributor

Re: Conditional field from backend which depends upon the value of record no 1 and record no 2 values...

Sorry I didn't get you what you have suggested..

I have to create one more conditional field which the logic is mentioned above.

Thanks for your reply.

chandu441
Contributor

Re: Conditional field from backend which depends upon the value of record no 1 and record no 2 values...

Thanks for your reply Andrey,

Condition is ok.., 1st record and 2nd Record is mentioned for your understanding Field name is DAYS which is in screenshot how can i include the condition to select second record DAYS value is the problem?

chandu441
Contributor

Re: Conditional field from backend which depends upon the value of record no 1 and record no 2 values...

Hi All,

Here is the resolution which is success.

NoConcatenate

FINAL_DATA:

LOAD

*,

IF([Opened Date]>Finish OR [Closed Date]<[Start],'NA',

IF([Closed Date]<Finish,[Closed Date]-[Opened Date],

IF([Closed Date]>Finish,Finish-[Opened Date]

,'NA'))) AS DAYS,

'FW'&' '&FW&'-'&Right(YEAR_YYYY,2) AS Week_Year

Resident SFDC

Order by [Case Number],Start_Num desc,;

DROP Table SFDC;

Final:

Load *,

IF ( ( [Case Number] = Previous([Case Number]) ) AND (DAYS<>'NA' and Previous(DAYS)<>'NA') ,'Backlog','Null') as BL

Resident FINAL_DATA;

DROP Table FINAL_DATA;