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

How to use field value as text in set analysis

Hi Experts,

I have a field(Speed Brackets) with 4 values in it , one of the value is   "=< 17Mb",

I want above value to be filtered using set analysis,

this is how i am using currently but getting incorrect value

sum({<[Speed Brackets]={'=< 17Mb'}>}[Speed Value])

Please suggest! Thanks in advance

Labels (3)
1 Solution

Accepted Solutions
sidhiq91
Specialist II
Specialist II

@Nitish91  I guess since your string containg something like <=17MB, Set Analysis is not able to interpret it corretly.

So to avoid such confusion I have a created another field which will convey the same <=17MB in words. Please see the below script.

NoConcatenate
Temp:
Load [Speed Value],
[Speed Brackets],
if(Match([Speed Brackets],'=<17MB'),'Less or Equal to 17MB',
if(Match([Speed Brackets],'>17MB<=50MB'),'Greater than 17MB and less than 50MB',
if(Match([Speed Brackets],'>50B<=100MB'),'Greater than 50MB and less than 100MB',
'Greater than 100MB'))) as [Speed Brackets Category]

Inline [
Speed Value, Speed Brackets
100,=<17MB
200,>17MB<=50MB
300,=<17MB
400,>50B<=100MB
500,>100MB
];

Exit Script;

Now in the front end I use the below expression.

Sum({<[Speed Brackets Category]={'Less or Equal to 17MB'}>}[Speed Value])

And I got the desired output. 

If this resolves your issue, please like and accept it as a solution.

View solution in original post

2 Replies
Frank_S
Support
Support

It's not clear what your requirement is.

In any case, suggest that you use the set analysis builder tools to correctly format your expression.

 

Make the necessary selection or selection in your App/Chart

Open your measure within the chart object which you wish to apply your set expression to.

Open the expression editor for the measure

Place your curser after the first open bracket "("

Insert your set expression with the set expression tool as shown in the image below.

 

 

This will at least ensure you are formatting your set expression accurately.

The result will be that only data from years 2017 and 2018 will appear in the chart output despite any other selections that are made.

 

For additional assistance, visit help and videos on creating set expressions:

 

Kind regards...

 

 

 

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sidhiq91
Specialist II
Specialist II

@Nitish91  I guess since your string containg something like <=17MB, Set Analysis is not able to interpret it corretly.

So to avoid such confusion I have a created another field which will convey the same <=17MB in words. Please see the below script.

NoConcatenate
Temp:
Load [Speed Value],
[Speed Brackets],
if(Match([Speed Brackets],'=<17MB'),'Less or Equal to 17MB',
if(Match([Speed Brackets],'>17MB<=50MB'),'Greater than 17MB and less than 50MB',
if(Match([Speed Brackets],'>50B<=100MB'),'Greater than 50MB and less than 100MB',
'Greater than 100MB'))) as [Speed Brackets Category]

Inline [
Speed Value, Speed Brackets
100,=<17MB
200,>17MB<=50MB
300,=<17MB
400,>50B<=100MB
500,>100MB
];

Exit Script;

Now in the front end I use the below expression.

Sum({<[Speed Brackets Category]={'Less or Equal to 17MB'}>}[Speed Value])

And I got the desired output. 

If this resolves your issue, please like and accept it as a solution.