Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested if Statement

hi.

i wish to create the following nested if statement however my result is 0, although their is no sign of an exception

IF([Delivery Terms] < '50',

(Sum(If([Order Row No Discount] = 'N',

([Förs pris] * if(isNull([Förs-kurs]),1,[Förs-kurs]) * [Order Quantity]) * (1 + OrderRad_Rabatt),

([Förs pris] * if(isNull([Förs-kurs]),1,[Förs-kurs]) * [Order Quantity]) * (1+ [Order Header Discount]) * (1 + OrderRad_Rabatt))))

-

Sum((If([Order Row No Discount] = 'N',

([Förs pris] * if(isNull([Förs-kurs]),1,[Förs-kurs]) * [Levererat Antal]) * (1 + OrderRad_Rabatt),

([Förs pris] * if(isNull([Förs-kurs]),1,[Förs-kurs]) * [Levererat Antal]) * (1+ [Order Header Discount]) * (1 + OrderRad_Rabatt))))

however the problem seems to be that it returns 0.

when i choose delivery terms in the selection box however, then the result shows correctly.

any ideas how to achieve the following?

Best

Brad

3 Replies
Not applicable
Author

Please try this for Total OrderStock:

(Sum ({1<[Delivery Terms]={"<=50"}>}(If([Order Row No Discount] = 'N',

([Förs pris] * if(isNull([Förs-kurs]),1,[Förs-kurs]) * [Order Quantity]) * (1 + OrderRad_Rabatt),

([Förs pris] * if(isNull([Förs-kurs]),1,[Förs-kurs]) * [Order Quantity]) * (1+ [Order Header Discount]) * (1 + OrderRad_Rabatt))))

-

Sum({1<[Delivery Terms]={"<=50"}>}(If([Order Row No Discount] = 'N',

([Förs pris] * if(isNull([Förs-kurs]),1,[Förs-kurs]) * [Levererat Antal]) * (1 + OrderRad_Rabatt),

([Förs pris] * if(isNull([Förs-kurs]),1,[Förs-kurs]) * [Levererat Antal]) * (1+ [Order Header Discount]) * (1 + OrderRad_Rabatt))))

)

Not applicable
Author

Hi that fix is already applied on Total Orderstock, the KPI i wish to define is below and is called Warehouse Orderstock.

Best

Brad

Not applicable
Author

Oops.Please use this for Warehouse Orderstock

Sum(If([Order Row No Discount] = 'N' and [Delivery Terms] < 50,

[Förs pris] * Alt([Förs-kurs] * [Order Quantity],1) * (1 + OrderRad_Rabatt),

([Förs pris] * Alt([Förs-kurs] * [Order Quantity],1) * (1+ [Order Header Discount]) * (1 + OrderRad_Rabatt))))

-

Sum(IF([Delivery Terms] < '50' and [Order Row No Discount] = 'N',

[Förs pris] * Alt([Förs-kurs] * [Levererat Antal],1) * (1 + OrderRad_Rabatt),

([Förs pris] * Alt([Förs-kurs] * [Levererat Antal],1) * (1+ [Order Header Discount]) * (1 + OrderRad_Rabatt))))