Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
dseelam
Creator II
Creator II

Condition

Hello All,

Attached files has item types with Demand and ONHAND, I am trying to get active, slow moving and obsolete item types

I need

sum(if(DMND>0,(DMND>ON_HAND),ON_HAND)) //////////active

sum(if(DMND<>0,(ON_HAND>-DMND),HAND)) ////////////////////slow

sum(if(DMND=0,ON_HAND>DMND,ON_HAND)) //////////////////////obs


but where ever ONHAND is '0'its giving me -1 which is wrong is there any other way to do it ?

Thanks,

D

1 Solution

Accepted Solutions
Anil_Babu_Samineni

This condition should work

If(DMND > ON_HAND and DMND >0 and DMND <>0 , If(ON_HAND>DMND,Sum(ON_HAND)))

From your data, you may don;t have ON_HAND values > DMND Values. For this you can check. Whether you have value or it showing all "There are no Exceed"

If(DMND > ON_HAND and DMND >0 and DMND <>0 , If(ON_HAND>DMND,Sum(ON_HAND),'There are no Exceed'))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

3 Replies
Anil_Babu_Samineni

May be this?

If(DMND > ON_HAND, Sum(ON_HAND))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dseelam
Creator II
Creator II
Author

Thanks anil

How to include other condition DMND should be always >0

Anil_Babu_Samineni

This condition should work

If(DMND > ON_HAND and DMND >0 and DMND <>0 , If(ON_HAND>DMND,Sum(ON_HAND)))

From your data, you may don;t have ON_HAND values > DMND Values. For this you can check. Whether you have value or it showing all "There are no Exceed"

If(DMND > ON_HAND and DMND >0 and DMND <>0 , If(ON_HAND>DMND,Sum(ON_HAND),'There are no Exceed'))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful