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: 
surajap123
Creator III
Creator III

cal field

Hi All,

I have a model with 2 tables, TableA & TableB(both are linked). I want to write a calculated field in tableA like below-

if(field1 = 'aa' and field2 = 'yy', 'n/a', field3) field3

But the field2 is in tableB.

Is there a way to write the condition without bringing the field2 into tableA?

When i try to do resident and join to bring the field2 into tableA, i see change in no. of records and worried that if effect the existing UI calculations.

When i try applymap, i am missing values in field2.

Please suggest the best approach.

Thanks!!

5 Replies
sunny_talwar

Hi Suraj -

We might be able to help better if you are able to share a sample.

surajap123
Creator III
Creator III
Author

Hi Sunny, I have attached the test app.

Not applicable

You can't join Field2 into TableA like this:

Left Join(TableA)

LOAD Field2

Resident TableB;

QlikView wouldn't know how to connect them

This should do the Job:

Left Join(TableA)

LOAD

  lid,

  Field2 as TableA.Field2

Resident TableB;

Anonymous
Not applicable

Hi Suraj,

TableA:   

    LOAD *                    

    INLINE [

    lid, Field1, Field3

    1, TKT, ET

    2, PKT, ME

    3, UT, ET

];

TableB:

LOAD * INLINE [

    amt, lid, Field2

    34, 1, 01/01/2016

    363, 1, 01/02/2016

    636, 2, 01/05/2016

    674, 1, 01/06/2016

    356, 3, 01/06/2016

   

];

Left Join(TableB)

LOAD *

Resident TableA;

Left Join (TableB)

LOAD

    lid,

    Field2,

    Field1,

    if(Field1 = 'TKT' and Field2 >= '01/05/2016','ME', Field3) as Field3_New

RESIDENT TableB;

Regards!!!

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

Please make a table where you explain your desired result so that we provide you a solution

I'll try to figure something out of problem...

Regards,

MB