Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Mani_K
Contributor II
Contributor II

Filter to select all values

Hi Community,

I have a measure with below code. 

Count({<FinancialYearH = {"$(=getfieldselections(FinancialYearLF))"}>} HAZARD_ID)

I am forcing to get hazard count of particular FY. So achieve this, I have created a filter on  "FinancialYearLF"  field with option of always select only one. So user will get only one FY count at time. But the requirement changed now and users want to select one or multiple Financial Years at any time. Is there a work around to get this? If nothing is selected, then count is getting 0 and I don't want that. It should be fine even if all years are selected in beginning and allowing users to toggle between different financial years. 

If don't use above condition, and simply use count(HAZARD_ID), I am not getting the right number.

Is there a way to select more than one value in a filter by default? 

Labels (5)
2 Solutions

Accepted Solutions
Chanty4u
MVP
MVP

Try this 

Count(

  {

    <FinancialYearH = 

      {"=if(GetSelectedCount(FinancialYearLF), Match(FinancialYearH, '$(=Concat(DISTINCT FinancialYearLF, "','"))')"}

    >

  } 

  HAZARD_ID

)

View solution in original post

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

We dont know your data model so it is hard to say more, but if your requirement is to force FinancialYearH to filter based on FinancialYearLF values then below is one of the options aas long as both fields are actually of the same type:

Count({<FinancialYearH = P(FinancialYearLF)>} HAZARD_ID)

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

3 Replies
Chanty4u
MVP
MVP

Try this 

Count(

  {

    <FinancialYearH = 

      {"=if(GetSelectedCount(FinancialYearLF), Match(FinancialYearH, '$(=Concat(DISTINCT FinancialYearLF, "','"))')"}

    >

  } 

  HAZARD_ID

)

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

We dont know your data model so it is hard to say more, but if your requirement is to force FinancialYearH to filter based on FinancialYearLF values then below is one of the options aas long as both fields are actually of the same type:

Count({<FinancialYearH = P(FinancialYearLF)>} HAZARD_ID)

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Mani_K
Contributor II
Contributor II
Author

Thanks community. Both solutions worked for me.