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

Replacing Field Value already loaded

I load data into Fact table from our ERP system and I have a field called Payer.  I then Left Join to Fact data in a spreadsheet that has the fields Payer and Exclude.  The Exclude field will have the value of 'Y' in it.  Now  the Exclude field in Fact will have a 'Y' or it will be Null.

My Question:

After I have done the above (Fact table is now loaded with Payer and Exclude fields, I want to go through a differnet logic process, something like if Payer = X and some other field = Z Change the Exclude field from Y to N.  Is there a way to overwrite the value of a field?

Thanks,

2 Replies

Re: Replacing Field Value already loaded

Don't do the join. Instead, start by loading the Payer and Exclude fields from the Excel sheet:

Load

          Payer as ExcludedPayer

          From Excel ...

          Where Exclude = 'Y'.

 

Then load your fact table:

Load <all_other_fields>,

          if( Exists(ExcludedPayer,Payer), // if Payer already exists in the previous table

           if( Payer = 'X' and Field2 = 'Z', 'N', 'Y'),

           'N' ) as Exclude

          From FactTable;

... or some similar logic in the if-function.

HIC

whiteline
Honored Contributor II

Re: Replacing Field Value already loaded

I think, only if you load them into another table.

Community Browser