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: 
madmax88
Creator II
Creator II

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
Master II
Master II



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
Vegar
MVP
MVP

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]
pradosh_thakur
Master II
Master II



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.
madmax88
Creator II
Creator II
Author

Worked, Thanks both!