Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sujit_nath
Creator III
Creator III

Load data for multiple conditions simultaneously

My requirement is as such:

I have a csv from which I am loading the data. 

-Suppose I have 3 conditions

1. field A = 'Y'

2.feild B='N'

3.feild C<>'Y'

 

-So, my load statement would be like --

load * from myfile

where

field A = 'Y'

AND

feild B='N'

AND

feild C<>'Y'

;

-Now I want to check how many records are eliminated only due to feild c<>'Y' , but my actual load should contain that elimination.

How do I achieve that?

Labels (1)
3 Replies
VishalWaghole
Specialist II
Specialist II

Hi Sujit,

In first load you can load all rows without using where clause. Once load then assign noofrows to one variable using NoOfRows function. Then take resident load from above table there you can use where condition as Field C not equal to Y. Again store noofrows from newly loaded table to one more variable. Then you can substract new variable from previous one and assign that value to final variable. Final variable will store your number that you want. After this again load data from first loaded table there you can use field A and field B condition in where clause and concatenate that with table where you have used field C condition.

Hope you understand.

Thanks,
Vishal Waghole
anushree1
Specialist II
Specialist II

sunny_talwar

May be do another load like this

ExclusionCount:
LOAD Count(feild C) as CountFieldC FROM myfile Where feild C <> 'Y';

Concatenate(ExclusionCount)
LOAD Count(feild B) as CountFieldB
FROM myfile
Where feild B='N';

Concatenate(ExclusionCount)
LOAD Count(feild A) as CountFieldA
FROM myfile
Where field A = 'Y';