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

Display count of Subsectors which acquires 80% of the Market in a Text object

Hi Everyone,

I want to display the count of Subsectors acquiring 80% of the Market in a text object.

There's a unique id which defines the Market Size for e.g., Id=6. If i use this in a set expression, it gives me the market size values corresponding to the respective sub sectors.

Dimension- [Sub Sectors]

Set Expression: Sum({$<Id={6}, Year={2017}>}[Market Size Values])    (for the current year). This gives me the result as shown in the below table:

Sub Sectors Market Size Values
Sub Sec11000
Sub Sec22000
Sub Sec33000
Sub Sec44000
Sub Sec55000

But, if i've to display the count of subsectors which acquires 80% of the Market in a text object, how can we achieve this? Please advise.

Thanks,

Zain Shaikh

4 Replies
Kushal_Chawda

try this

=Count({<[Sub Sectors] ={"=(Sum({$<Id={6}>}[Market Size Values])/Sum( total {$<Id={6}>}[Market Size Values]))<=0.8"}>} DISTINCT [Sub Sectors])

Not applicable
Author

Thanks Kushal for your help but, it's giving me the total count of Sub Sectors.

Not applicable
Author

I'm trying below expression. Kindly check if it's correct or not and let me know.

=Count({<[Sub Sectors] ={"=RangeSum(Above(Sum([Market Size Values]),0,RowNo()))/Sum(TOTAL [Market Size Values]) <= 0.8"}>} DISTINCT [Sub Sectors] )

Kushal_Chawda

try this

Count({<[Sub Sectors] ={"=(Sum({$<Id={6}>}[Market Size Values])/Sum( total  <[Sub Sectors]>{$<Id={6}>}[Market Size Values]))<=0.8"}>} DISTINCT [Sub Sectors])