Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor

If Statement in Load Script Problems!

Hi all,

I am currently trying to join a new field to another existing table.

My existing tables, consist of the fields:

  • ObjectName -  which is the number of excel sheet files. IE: Sheet1, Sheet2, Sheet4......etc
  • IsOld - a field that has the old file sheets
  • IsNew - a field that has the new file sheets.

Capture.PNG

Code for the table:


NoConcatenate


EffectiveObjects:

Load

    ObjectName

Resident

    ObjectsList

Where IsOld = 1 and IsNew = 1;

Code for field I want to join:

sub CheckTables

Load *,

    ObjectName,

    if(NullCount(Pick(Match(ObjectName,'Sheet1','Sheet2','Sheet4'), Old_Sheet1.ObjectID,Old_Sheet2.ObjectID,New_Sheet4.ObjectID ) )>0,'Table Different', 'Table Same') AS Checkfield;

However, this gives me errors before I can even join the field. I want to add one more field to this table, as Difference Check, which results whether or not the two tables have any change to them. Both tables are the same, and have a key generated for each sheet. If there are any differences there will be nulls. I know my if statement works as it works in the front end but I am having extreme difficulties where it works in the script.


The result should look like this:


Capture2.PNG

Any help would be great!

0 Replies