Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Filter on a measure

Hi everybody. 

An user ask us to make himself a measure based on a filter. It is possible?

If we have one dimension (Country) and one measure (Sales), could him make a chart with "total sales" vs "Germany Sales" without making an specific measure for Germany?

 

Thanks in advance. 

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Master II
Master II

Hi 

 

If you are using Qliksense do the following

 

add the below to the script

load * inline [

dim

1

2

];

Reload

Add below as your dimension

First dimension  [Month Year]

Second dimension  pick(dim, Country,'Total')

 

Expression

Sum(Sales)

 

Learning never stops.

View solution in original post

9 Replies
Highlighted
Master II
Master II

Sum({<Country={'Germany'>}Sales)  will give you sales for germany. Is this what you wanted.

Please check the field names and value or it may throw an error.

Learning never stops.
Highlighted

Sure, you can use set analysis for this

Total Sales

Sum(Sales)

Germany Sales

Sum({<Country = {'Germany'}>}Sales)
Highlighted
Contributor II
Contributor II

I'm sorry but I can't use set analysis. 

 

We have a master measure named SALES and we want to know how can the user use this unique measures in both cases, Total sales and Germany Sales in the same chart

 

Thanks

Highlighted
Master II
Master II

Why not create another master measure for user called GermanySales, they can drag Germany sales to see the total. I can't think of any other than changing the script that could do this. It would be easier if you create it in the UI.

Learning never stops.
Highlighted
Contributor II
Contributor II

Because Germany is just an example. They want to make comparisons between a country(Germany, Italy, USA...) and the Total Sales.

Thanks
Highlighted

I think I fail to understand what you are trying to do. Why can't you use set analysis here? Can you share a flow of events that will happen and what you would want to see at the end?

Highlighted
Contributor II
Contributor II

 

We have a data set like this. Sales by country and month.

 Captura3.PNG

And we want to do something like this, but with only one expression. We don't want an expression for each country because we have sales, quantity, ebit... and maybe 25 countries. It will make about 150 expressions. 

Is there a way to the user drag the Sales expression and filter it by a country? Then we had Sales of a country vs Total sales

 

 Captura2.PNG

 

Highlighted

Create a line chart with monthyear as first dimension and country as second dimension. and use Sum(Sales) as expression. Now go to Dimension limits tab and check box for the total.

Highlighted
Master II
Master II

Hi 

 

If you are using Qliksense do the following

 

add the below to the script

load * inline [

dim

1

2

];

Reload

Add below as your dimension

First dimension  [Month Year]

Second dimension  pick(dim, Country,'Total')

 

Expression

Sum(Sales)

 

Learning never stops.

View solution in original post