Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QLIKWORLD LIVE! MAY 16 - 19TH, EARLY BIRD DISCOUNTS! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
beaker99
Contributor
Contributor

Chart Expressions- if then else/ nested Ifs

Hi,

Am using the following script in an expression which is returning values as based on the conditions:-

=sum(if((year(enquiry_award_loss_date)=YR and month(enquiry_award_loss_date)=Mth and (TeamStatus = 'Active') and (opheadm.status<9)and (Whiteboardexclusion<>'1'), if((opdetm.spare)>'0',opdetm.val/opdetm.spare,opdetm.val)))

  This works however, I need to add another  calculation changing the opdetm.val returned to a negative if the following field:- opheadm.Order_No like 'CN%' .

Can anyone help?

3 Replies
Not applicable

How about

sum(if((year(enquiry_award_loss_date)=YR and month(enquiry_award_loss_date)=Mth and (TeamStatus = 'Active') and (opheadm.status<9)and (Whiteboardexclusion<>'1'), if((opdetm.spare)>'0',

if(Wildmatch(opheadm.Order_No,'CN?'), -1*  opdetm.val/opdetm.spare, opdetm.val/opdetm.spare),  opdetm.val)))

beaker99
Contributor
Contributor
Author

Hi Ajay,

The CN still displays a positive value . This is what happens each time for me but thank you for responding.

Rgds

Jeff

Not applicable

Another thought. You can check this expression

if(Wildmatch(opheadm.Order_No,'CN?')  so here it will be true only if there are three letters like CNA or CNS. But if there are more letters like ACNbi or CNlio then it will always fail. For those you can use '*cn*'


Thanks