Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
stekol61
Creator
Creator

Filter a calculation

I have added a filter to my app and i want to be able present result from this expression for different countries (wor_Country_S).

What is the best way to do this?

Count({<Week_S={'$(v_currentWeek)'} , wor_country_S >} wor_ticket_ID_S)

2 Solutions

Accepted Solutions
stekol61
Creator
Creator
Author

i solved this by:
f ((wor_country_S= 'SE'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}SE)),
If ((wor_country_S= 'NO'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}NO)),
If ((wor_country_S= 'FI'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}FI)),
If ((wor_country_S= 'EE'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}EE)),
If ((wor_country_S= 'LT'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}LT)),0)))))

View solution in original post

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You may want to consider loading this data with a CrossTable load.

CrossTable(Country, TicketCount)
LOAD F1 as new_cur_week,
SE,
FI,
NO,
EE,
LT
FROM

Which will produce a data table like this:

2019-03-08_7-35-57.png

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

7 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to show for each country, the simplest method is to create a table chart with wor_Country_S as DImension.

If you want calculate for a specific country, for example in a KPI, add the country name into your set analysis. 

Count({<Week_S={'$(v_currentWeek)'} , wor_country_S={'Austria'} >} wor_ticket_ID_S)

BTW, I'm not sure why you have wor_country_S  by itself in the expression you posted. 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

stekol61
Creator
Creator
Author

I will present the result as a 'KPI' and want to  select any of six different countries.

Should a use set analysis for that?

 

I use wor_country_S  by itself in the expression just for test purpose to present the result for all countries in a table.

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You don't need any set analysis for the country. Just create a filterbox and let the user select.  Only selected countries will be included in the KPI.

-Rob

stekol61
Creator
Creator
Author

Hi!

Count({<Week_S={'$(v_currentWeek)'} , wor_country_S >} wor_ticket_ID_S)

I removed 'wor_country_S' from the expression and then i can filter per Country.

 

Similar problem with my second expression.

Hardcode country as below work.

How can I get the Country filter works for this expression?

MinString({<new_cur_week = {'$(v_currentWeek)'}>}SE)

stekol61
Creator
Creator
Author

Hi!

What might complicate the expression is the format of the data loaded

(MinString({<new_cur_week = {'$(v_currentWeek)'}>}SE))

 SEFINOEELT
2019-610432372712
2019-710432372712
2019-810432372712
2019-910131362612
2019-109429332411
2019-119429332411
2019-129429332411

 

LOAD
F1 as new_cur_week,
SE,
FI,
NO,
EE,
LT
FROM

LET v_currentWeek = Replace(weekname(today()),'/','-');

stekol61
Creator
Creator
Author

i solved this by:
f ((wor_country_S= 'SE'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}SE)),
If ((wor_country_S= 'NO'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}NO)),
If ((wor_country_S= 'FI'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}FI)),
If ((wor_country_S= 'EE'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}EE)),
If ((wor_country_S= 'LT'), (MinString({<new_cur_week = {'$(v_currentWeek)'}>}LT)),0)))))
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You may want to consider loading this data with a CrossTable load.

CrossTable(Country, TicketCount)
LOAD F1 as new_cur_week,
SE,
FI,
NO,
EE,
LT
FROM

Which will produce a data table like this:

2019-03-08_7-35-57.png

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com