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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
drohm002
Creator II
Creator II

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

how about in the script?

sunny_talwar

May be this

LOAD Sum(LOS) as SumLOS

Resident ...

Where Match(CC_FLAG, 1, 2);