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

Filter the data from expressions

Hey Guys,

I have a data set where I have to sort the data ascending and descending as per the filtered option.

Here is an example of what I need to do:

Data set -

1. Countries, Profit margins

2. Range of profit margins

First filter - Take upper or lower profit margins

Second filter - ascending or descending

I have created a chart and list box with the if statements : =if((sum(ALLOCATION1_EBIT)/sum([LC-NET_REV]))>=Upper, 'Yes', 'No')

(sum(ALLOCATION1_EBIT)/sum([LC-NET_REV]) = Profit margins

I get something like this.

Customer Country OPM UpperOPM Lower
NoNo
AlbaniaYesNo
AlgeriaNoYes
AndorraNoNo
AngolaYesNo
EtcEtc----Etc---



Now I need to filter with OPM Upper or Lower. Can someone please help?


--->A-man

2 Replies
qlikviewwizard
Master II
Master II

Hi,

Please attach the sample application.

marcus_sommer

I think you will need aggr() to create such filter:

Listbox-expression with and without if-loop:

if(aggr(sum(ALLOCATION1_EBIT)/sum([LC-NET_REV]), [Customer Country])>=Upper, 'Yes', 'No')

aggr(round(sum(ALLOCATION1_EBIT)/sum([LC-NET_REV]), 0.01), [Customer Country])

Maybe an alternatively is to cluster the results with class - within the listbox or in the chart:

class(aggr(sum(ALLOCATION1_EBIT)/sum([LC-NET_REV]), [Customer Country]), 0.01)

- Marcus