Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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])))
=(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]))
)
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])) )
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])))
Thanks for your reply.
Solution from both Sunny and Thirumala work.
Once again, thanks for your help.
Shamit