Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
drohm002
Creator
Creator

how to create a field based off other fields

HI,

I have a field, LOS, that contains values 1 through 100.  I have another field that is a flag called, CC_FLAG.  The values is this field are 0,1, and 2.  I want to create a field that sums the LOS field when the CC_FLAG equals 1 or 2.  Please help!

4 Replies
YoussefBelloum
Champion
Champion

Hi,

you can try this on the script:

table:

load

.

.

if(match(CC_FLAG,'1','2'), LOS) as LOS_count


FROM...


then you can sum it on the front end

sunny_talwar

In the script? Or front end... for front end try this

Sum({<CC_FLAG = {1, 2}>}LOS)

drohm002
Creator
Creator
Author

how about in the script?

sunny_talwar

May be this

LOAD Sum(LOS) as SumLOS

Resident ...

Where Match(CC_FLAG, 1, 2);