Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
thanos1
Contributor
Contributor

Preceding load question

DummyData:
load*,if("Company"='C 4',test1) as test2;
load *, if("Company"='C 34',[Business Unit]) as test1;
LOAD * INLINE [
Company, Business Unit
C 34, BU A
C 4, BU B
C 4, BU C
C 4, BU D
C 4, BU E
];

/*
t1:
load *,
if("Company"='C 4',test1) as test2
Resident DummyData;
drop Table DummyData;*/

Neither preceding nor resident works, please explain why this does not work.(Any solution without Mapping Table)

Thanks

2 Replies
Chanty4u
MVP
MVP

Check your data has c4..

 

But your p.load having pc 4

DummyData:

LOAD *,

     IF(Company = 'C 4', test1) AS test2;

LOAD *,

     IF(Company = 'C 34', [Business Unit]) AS test1

INLINE [

Company, Business Unit

C 34, BU A

C 4, BU B

C 4, BU C

C 4, BU D

C 4, BU E

];

henrikalmen
Specialist II
Specialist II

This is what happens:

1) A table is created with two fields: Company, Business Unit

2) A new field is added, called "test1". On the row where Company='C 34' it holds the value 'BU A', on all other rows it is empty (null).

3) Yet another field is created, "test2". It is empty (null) on all rows, since the field test1 is empty on the rows where Company='C 4' (and the if-statement assigns no value to rows where Company is anything but 'C 4').