Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ramp1985
Contributor II
Contributor II

Calculation in Set Analysis per week

Hi all,

I have an Expression counting the amount of Order ID, where each segment ID has an Occupancy at 0%.

It works great when I filter on one specific week, but when I for example choose two weeks, I need the formula to perform the calculation on each week on each segment ID, and not only if Segment ID is zero on both weeks. Any suggestions on how to make this Calculation inside a set Analysis per week, and not just on total for all weeks? 

------------------------------------------------------------------------------------------------------------------------------

Count({<Year={$(=Max(Year))},[Group1],[ Group2]={"AB"},

[Segment ID] = {'=

If(

(1-((sum({<[Group1],[ID]={3},[Group2]={"AB"}>} [Sold])

/

(Sum({<[Group1],[Group2]={"AB"}>}[Capacity])-

Sum({<[Group1],[Group2]={"AB"}>}[Block])))))

=1,

(1-((sum({<[Group1],[ID]={3},[Group2]={"AB"}>} [Sold])

/

(Sum({<[Group1],[Group2]={"AB"}>}[Capacity])-

Sum({<[Group1],[Group2]={"AB"}>}[Block])))))

=1)

'}

>} [Order ID])

Labels (3)
2 Replies
Kushal_Chawda

Would you be able to share sample with expected output?

ramp1985
Contributor II
Contributor II
Author

No sorry, But I have simplyfied the formula:

 

Count({<Year={$(=Max(Year))},[Group1],[ Group2]={"AB"},

[Segment ID] = {'=

If(

(1-((sum({<[Group1],[ID]={3},[Group2]={"AB"}>} [Sold])

/

(Sum({<[Group1],[Group2]={"AB"}>}[Capacity])-

Sum({<[Group1],[Group2]={"AB"}>}[Block])))))

=1)

'}

>} [Order ID])