Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
madmax88
Contributor

Use Condition in Script from previous loaded data

Hi all,

 

I Need to use data from a previous loaded data in the same script. Eg.

Table 1:

ID,

IF(SalesP_A='x','Y',

IF(SalesP_B='x','Y')) as SalesAggr

 

From

XYZ

 

Table 2:

ID,

IF (SalesAggr = 'Y','great') as SalesAggr_2

 

From

XYZ

But this doesn't work. Any idea? I heard something about resident table, but also this doesnt work really..

1 Solution

Accepted Solutions
pradosh_thakur
Honored Contributor II

Re: Use Condition in Script from previous loaded data



Table1:

ID,

IF(SalesP_A='x','Y',

IF(SalesP_B='x','Y')) as SalesAggr



From

XYZ



Table 2:

ID,

IF (SalesAggr = 'Y','great') as SalesAggr_2



RESIDENT

Table1;

You need to use th resident load for previously loaded data

Learning never stops.

View solution in original post

3 Replies
Partner
Partner

Re: Use Condition in Script from previous loaded data

Try preceding load

Table 1:
Load *,
IF (SalesAggr = 'Y','great') as SalesAggr_2
;
Load
ID,
IF(SalesP_A='x','Y',
IF(SalesP_B='x','Y')) as SalesAggr
From
XYZ
;

-----
Another way is to use resident load

Table 1:
ID,
IF(SalesP_A='x','Y',
IF(SalesP_B='x','Y')) as SalesAggr
From
XYZ;


Table 2:
ID,
IF (SalesAggr = 'Y','great') as SalesAggr_2
RESIDENT
[Table 1]
Plees ekskuse my Swenglish and or Norweglish spelling misstakes
pradosh_thakur
Honored Contributor II

Re: Use Condition in Script from previous loaded data



Table1:

ID,

IF(SalesP_A='x','Y',

IF(SalesP_B='x','Y')) as SalesAggr



From

XYZ



Table 2:

ID,

IF (SalesAggr = 'Y','great') as SalesAggr_2



RESIDENT

Table1;

You need to use th resident load for previously loaded data

Learning never stops.

View solution in original post

madmax88
Contributor

Re: Use Condition in Script from previous loaded data

Worked, Thanks both!