Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jontan
Contributor
Contributor

IF AND Statement Not Working

Hi everyone,

Been cracking my head on this formula; what i like to present is 

1. Current GP after Profit Share 

2. For Values less than 0

 

IF(SUM([GP After Profit Share (EUR)])<0 AND [Accounting Year] = Year(now()))), Sum ([GP After Profit Share (EUR)])

Labels (1)
1 Solution

Accepted Solutions
kaanerisen
Creator III
Creator III

Hi Jontan,

You can simply do that by using set analysis. But you need an unique field(e.g. UniqueID) in the dataset you use.

 

Sum({<UniqueField={"=SUM([GP After Profit Share (EUR)])<0"},[Accounting Year]={$(=Year(now()))}>}[GP After Profit Share (EUR)])

 

Hope it helps, 

View solution in original post

4 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi 

this expressions will only work as measure in chart 

try this 

IF(SUM([GP After Profit Share (EUR)])<0 AND [Accounting Year] = Year(now()), Sum ([GP After Profit Share (EUR)])

you had some extra brackets in your expression

kaanerisen
Creator III
Creator III

Hi Jontan,

You can simply do that by using set analysis. But you need an unique field(e.g. UniqueID) in the dataset you use.

 

Sum({<UniqueField={"=SUM([GP After Profit Share (EUR)])<0"},[Accounting Year]={$(=Year(now()))}>}[GP After Profit Share (EUR)])

 

Hope it helps, 

jontan
Contributor
Contributor
Author

Hi Lironbaram,

 

Solution does not seem to work though

jontan
Contributor
Contributor
Author

Hi Kaanerisen,

 

It works!!! Thanks ....