Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
shamitshah
Partner - Creator
Partner - Creator

If Statement

Hi,

I need some help with an if statement.

I have the following expression which works,

num(Count (DISTINCT if(BST_QtyOnHand >(0),[Item Number])))-NUM(COUNT(DISTINCT{$<FiscalRecordYear={2016},SKH_Source={'SO'},BST_QtyOnHand={'<>0'}>}[Item Number]))

I need an if statement where if the result of the above is <0, then show '0', otherwise the result of the above statement.

Any ideas?

Thanks

Shamit

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Num(If(Count (DISTINCT {<BST_QtyOnHand = {'>0'}>} [Item Number]) - Count(DISTINCT{$<FiscalRecordYear={2016},SKH_Source={'SO'},BST_QtyOnHand={'<>0'}>}[Item Number]) < 0, 0, Count (DISTINCT {<BST_QtyOnHand = {'>0'}>} [Item Number]) - Count(DISTINCT{$<FiscalRecordYear={2016},SKH_Source={'SO'},BST_QtyOnHand={'<>0'}>}[Item Number])))

View solution in original post

4 Replies
pooja_sn
Creator
Creator

=(if(

num(Count (DISTINCT if(BST_QtyOnHand >(0),[Item Number])))-NUM(COUNT(DISTINCT{$<FiscalRecordYear={2016},SKH_Source={'SO'},BST_QtyOnHand={'<>0'}>}[Item Number]))

)<0,0,

num(Count (DISTINCT if(BST_QtyOnHand >(0),[Item Number])))-NUM(COUNT(DISTINCT{$<FiscalRecordYear={2016},SKH_Source={'SO'},BST_QtyOnHand={'<>0'}>}[Item Number]))

)

trdandamudi
Master II
Master II

May be like below:

If(num(Count (DISTINCT if(BST_QtyOnHand >(0),[Item Number])))-NUM(COUNT(DISTINCT{$<FiscalRecordYear={2016},SKH_Source={'SO'},BST_QtyOnHand={'<>0'}>}[Item Number])) <0,

0,

num(Count (DISTINCT if(BST_QtyOnHand >(0),[Item Number])))-NUM(COUNT(DISTINCT{$<FiscalRecordYear={2016},SKH_Source={'SO'},BST_QtyOnHand={'<>0'}>}[Item Number])) )


sunny_talwar

May be this:

Num(If(Count (DISTINCT {<BST_QtyOnHand = {'>0'}>} [Item Number]) - Count(DISTINCT{$<FiscalRecordYear={2016},SKH_Source={'SO'},BST_QtyOnHand={'<>0'}>}[Item Number]) < 0, 0, Count (DISTINCT {<BST_QtyOnHand = {'>0'}>} [Item Number]) - Count(DISTINCT{$<FiscalRecordYear={2016},SKH_Source={'SO'},BST_QtyOnHand={'<>0'}>}[Item Number])))

shamitshah
Partner - Creator
Partner - Creator
Author

Thanks  for your reply.

Solution from both Sunny and Thirumala work.

Once again, thanks for your help.

Shamit