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

If condition in edit script

Hi All,

 

How to write this IF condition in edit script .

 

=Alt(num(1.25*(count({<Status={'Good'},Activestatus={'Active'},Renewalstatus={'Yes'},
Type={'Renewal'},Stage={'Propose'},[EOD Quarter]=>}ID)

/

count({<Renewals=,Activestatus={'Active'},Renewalstatus={'Yes'},Type={'Renewal'},Stage={'Propose'},[EOD Quarter]=>}[ID])),'#.##'),0)

 

Thanks,

Deep.

Labels (3)
1 Solution

Accepted Solutions
Kushal_Chawda

You won't be able to write entire condition in script as it involves exclusion of some filter which is only front end feature. But you can create the Flags in script and use it to simplify the expression.

load *,

if( Status='Good' and Activestatus='Active' and Renewalstatus='Yes' and 
Type='Renewal' and Stage='Propose', 1,0) as Numerator,

if(Activestatus='Active' and Renewalstatus='Yes' and 
Type='Renewal' and Stage='Propose',1,0) as Denominator

FROM Source

Now you can use below formula on front end

=num(1.25*(Sum({<[EOD Quarter]>}Numerator)) / sum({<Renewals,[EOD Quarter]>}Denominator) ,'#.##')

View solution in original post

1 Reply
Kushal_Chawda

You won't be able to write entire condition in script as it involves exclusion of some filter which is only front end feature. But you can create the Flags in script and use it to simplify the expression.

load *,

if( Status='Good' and Activestatus='Active' and Renewalstatus='Yes' and 
Type='Renewal' and Stage='Propose', 1,0) as Numerator,

if(Activestatus='Active' and Renewalstatus='Yes' and 
Type='Renewal' and Stage='Propose',1,0) as Denominator

FROM Source

Now you can use below formula on front end

=num(1.25*(Sum({<[EOD Quarter]>}Numerator)) / sum({<Renewals,[EOD Quarter]>}Denominator) ,'#.##')