Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
bhaveshp90
Creator III
Creator III

How to show only negative values for expression?

Hello, 

I have a table as shown below;

Capture.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I am trying to show only negative values for YTD, I have tried to use if condition and even sorting is not working in the table. 

Where I'm doing wrong here, attached is the file for reference. 

 

thanks

Bhavesh 

Labels (2)
5 Replies
sunny_talwar

Try this

RangeMin(
((
(
(Sum(Updated_OEC_Budget)-Sum(Forecast_Cost_to_Complete))-(Sum(Prior_Updated_OEC_Budget)-Sum(Prior_Forecast_Cost_to_Complete))
)
*
if(Cost_Code=8,Sum({<Cost_Code={8}>}POC)/100,
if(Cost_Code=10,Sum({<Cost_Code={10}>}POC)/100,
if(Cost_Code=12,Sum({<Cost_Code={12}>}POC)/100,
Sum({<Cost_Code={8,10,12}>}POC)/300)))
)

+

(
	if(Cost_Code=8,Sum({<Cost_Code={8}>}Prior_Updated_OEC_Budget),
	if(Cost_Code=10,Sum({<Cost_Code={10}>}Prior_Updated_OEC_Budget),
	if(Cost_Code=12,Sum({<Cost_Code={12}>}Prior_Updated_OEC_Budget),
	Sum({<Cost_Code={8,10,12}>}Prior_Updated_OEC_Budget))))
	-
	if(Cost_Code=8,Sum({<Cost_Code={8}>}Prior_Forecast_Cost_to_Complete),
	if(Cost_Code=10,Sum({<Cost_Code={10}>}Prior_Forecast_Cost_to_Complete),
	if(Cost_Code=12,Sum({<Cost_Code={12}>}Prior_Forecast_Cost_to_Complete),
	Sum({<Cost_Code={8,10,12}>}Prior_Forecast_Cost_to_Complete))))
)
*
(

	If(Cost_Code=8, Num(
	(Sum({<Cost_Code={8}>}POC)/100
	-
	Alt(Above(TOTAL Sum({<MonthYear,YearMonth,Cost_Code={8}>}POC)/100, Num(Month)),0)),'###.##%'),
	
	If(Cost_Code=10, Num(
	(Sum({<Cost_Code={10}>}POC)/100
	-
	Alt(Above(TOTAL Sum({<MonthYear,YearMonth,Cost_Code={10}>}POC)/100, Num(Month)),0)),'###.##%'),
	
	if(Cost_Code=12,Num(
	(Sum({<Cost_Code={12}>}POC)/100
	-
	Alt(Above(TOTAL Sum({<MonthYear,YearMonth,Cost_Code={12}>}POC)/100, Num(Month)),0)),'###.##%'),
	
	Num(
	(Sum({<Cost_Code={8,10,12}>}POC)/300
	-
	Alt(Above(TOTAL Sum({<MonthYear,YearMonth,Cost_Code={8,10,12}>}POC)/300, Num(Month)),0)),'###.##%'),
	)))

)), 0)
bhaveshp90
Creator III
Creator III
Author

@sunny_talwar  when we add other expressions say MTD, we still see the Zero values for these projects which is not correct. Is there any way we can avoid those projects completely? 

 

Capture.PNG

sunny_talwar

What do you want to see?

bhaveshp90
Creator III
Creator III
Author

@sunny_talwar  , I want to see the top 10 MTD values (Projects with Negative values) in Descending order. 

I cannot able to sort the MTD expression in the table as shown below

Capture.PNG

Claudiu_Anghelescu
Specialist
Specialist

IF(your_expression < 0 , your_expression)
To help community find solutions, please don't forget to mark as correct.