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: 
sspawar88
Creator II
Creator II

Set analysis

Hi,

i'm working on expression in which i will

count all temperature which is less than -18 for XY branch_type /

Count of all temperature which is less than -1 for XY branch_type

but i have multiple branch_types and i'll use bar chart or pivot table.

but how can i use only one formulae for all

Count({$<param_name={'Temperature'},branch_type={'XY'}, param_value={'<=-18'}>}param_value)/

Count({<param_name={'Temperature'},branch_type={'XY'},param_value={'<=-1'}>}param_value)

How can i define only one formulae for all branch_types ?

4 Replies
sinanozdemir
Specialist III
Specialist III

Maybe something like this:

branch_type = {'XY', 'XZ', 'AB', 'CD'}

krishna_2644
Specialist III
Specialist III

Just use

Count({<param_name={'Temperature'},branch_type={'XY'},param_value={'<=-1'}>}param_value)


as -18 is less than -1.hence the values are already contained in that set.


or exclude the values between -1 and -18 to make it a single expression.

settu_periasamy
Master III
Master III

Hi,

try to Create one variable like the below

vcheck

=Concat(DISTINCT chr(39)&branch_type&chr(39),',')

then you can use this variable in your set expression

Count({$<param_name={'Temperature'},branch_type={$(vcheck)}, param_value={'<=-18'}>}param_value)/

Count({<param_name={'Temperature'},branch_type={$(vcheck)},param_value={'<=-1'}>}param_value)

if you are not interested to create the variable, directly apply the expression like the below

Count({$<param_name={'Temperature'},branch_type={$(=Concat(DISTINCT chr(39)&branch_type&chr(39),','))}, param_value={'<=-18'}>}param_value)

/

Count({<param_name={'Temperature'},branch_type={$(=Concat(DISTINCT chr(39)&branch_type&chr(39),','))},param_value={'<=-1'}>}param_value)

sspawar88
Creator II
Creator II
Author

Hi,

Concat(DISTINCT chr(39)&branch_type&chr(39),',')---can u please explain what it do actually?


How can it become helpful when i use pivot table where i have both branch_type  and region_name?


suppose i want calculation as like this in this formulae

count all temperature which is less than -1 for XY branch_type /

Count of all temperature which is less than -1 for region in which XY branch_type locates

can you please explain how this set analysis deal with such requirement ?