Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Logic with set of rules

Hi,

We have a logic in qlikiew

Logic:

Sales rate: (Sum(Sales)/Count(TransID))*100000

Formula Rules:

  1. If the numerator is greater than zero, but the denominator is zero, then the Sales rate is set to 1,000,000.
  2. If the numerator and denominator are both zero, then the Sales rate is zero.
  3. If the denominator is negative and the numerator is 0, then the Sales rate is set to 0.
  4. If the denominator is negative and the numerator is greater than zero, then the Sales rate is set to 1,000,000.

What would the qlikview logic followed with the above rules

14 Replies
neha_shirsath
Specialist
Specialist

1. If(Sum(Notifications)>0 and sum([Item Movement])=0, (Sum(Notifications)/sum([Item Movement]))*100000)

2.If(Sum( Notifications)=0 and sum([Item Movement])=0, (Sum(Notifications)/sum([Item Movement]))*0)

3.If(Sum( Notifications)=0 and sum([Item Movement])<0, (Sum(Notifications)/sum([Item Movement]))*0)

4.If(Sum( Notifications)>0 and sum([Item Movement])<0, (Sum(Notifications)/sum([Item Movement]))*1000000)

nareshthavidishetty
Creator III
Creator III
Author

Hi,

Thanks for the try.

I belive its not what i required.

Kindly find the below set of rules.

 

1. If the numerator is greater than zero, but the denominator is zero, then the Sales rate is set to 1,000,000.
2. If the numerator and denominator are both zero, then the Sales rate is zero.
3. If the denominator is negative and the numerator is 0, then the Sales rate is set to 0.
4. If the denominator is negative and the numerator is greater than zero, then the Sales rate is set to 1,000,000.

Thanks..

nareshthavidishetty
Creator III
Creator III
Author

Hi All,

I belive got the answer.

if(sum(Notifications)>0 and sum([Item Movement])=0,1000000,

if(sum(Notifications)=0 and sum([Item Movement])=0,0,

if(sum(Notifications)=0 and sum([Item Movement])<0,0,

if(sum(Notifications)>0 and sum([Item Movement])<0,1000000,

(sum(Notifications)/sum([Item Movement])*1000000)))))

Is there any way to get same results with out using 'IF' condition.

I would be really great..

Thanks..

nareshthavidishetty
Creator III
Creator III
Author

Hi,

Any other approach.

Thanks..

neha_shirsath
Specialist
Specialist

You can do this by calculating this logic to script level.