Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Mike75
Contributor II
Contributor II

creating an expression to sum two values together and return results greater than 1 only

Hi guys,

I'm trying to create an expression to sum two values together and return results greater than 1

My expression works but it also returns null or missing values and suppressing them on the presentation tab doesn't work  

=if(sum([Overtime FTE])+sum([FTE])>1,sum([Overtime FTE])+sum([FTE]))

My report also has 4 dimensions: Employee Code, Pay Period, Award Category and Hospital.

The report is set up as a pivot table. It works ok as a straight table but I need to pivot by Pay Period.

Any help would be greatly appreciated!

Cheers,

 

Mike

 

 

Labels (1)
4 Solutions

Accepted Solutions
TauseefKhan
Creator III
Creator III

Hi @Mike75,

Check this expression :

=If(Not IsNull(sum([Overtime FTE])) and Not IsNull(sum([FTE])) and sum([Overtime FTE]) + sum([FTE]) > 1, sum([Overtime FTE]) + sum([FTE]))


***Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.***

View solution in original post

Mike75
Contributor II
Contributor II
Author

Thanks very much for your help Sayed! I also just had to add rangesum instead of adding the fields together:

=if(sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE]))>1.5,sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE])))

View solution in original post

Mike75
Contributor II
Contributor II
Author

Thanks Tauseef! I'll try your method out as well but I reckon I'll need rangesum in there as in the solution below:

 

=if(sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE]))>1.5,sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE]))) 

View solution in original post

Mike75
Contributor II
Contributor II
Author

Thanks Marcus adding rangesum and the pay period dimension into the expression did the trick:

=if(sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE]))>1.5,sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE]))) 

View solution in original post

6 Replies
Sayed_Mannan
Creator
Creator

Hi, try this

=if(Sum({<PayPeriod>} [Overtime FTE] + [FTE]) > 1, Sum({<PayPeriod>} [Overtime FTE] + [FTE]))

 

here I use {<PayPeriod>} to apply the sum only within the selected pay period.

marcus_sommer

As far as the expression returned any valid result in regard to the vertical and horizontal dimension-values they will be displayed.

Beside this - by using +- operators you will get NULL as result as far as any of the parts in NULL or not numeric. It may the intended behaviour in your case but if not you could avoid it by using something like:

rangesum(Field1, Field2)

TauseefKhan
Creator III
Creator III

Hi @Mike75,

Check this expression :

=If(Not IsNull(sum([Overtime FTE])) and Not IsNull(sum([FTE])) and sum([Overtime FTE]) + sum([FTE]) > 1, sum([Overtime FTE]) + sum([FTE]))


***Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.***

Mike75
Contributor II
Contributor II
Author

Thanks very much for your help Sayed! I also just had to add rangesum instead of adding the fields together:

=if(sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE]))>1.5,sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE])))

Mike75
Contributor II
Contributor II
Author

Thanks Tauseef! I'll try your method out as well but I reckon I'll need rangesum in there as in the solution below:

 

=if(sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE]))>1.5,sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE]))) 

Mike75
Contributor II
Contributor II
Author

Thanks Marcus adding rangesum and the pay period dimension into the expression did the trick:

=if(sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE]))>1.5,sum({<[PayPeriodFinYear]>}rangesum([Overtime FTE],[FTE])))