Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Lakshminarayanan_J

Date Selection is not Working

Dear All,

Need a urgent Help on below requirement,

Need to display the data based on  Country and Month Selection .

Below Expression is Working Fine if we Select between = Sep20 to Dec20

Expression:

Scenario 1:

=if(COUNTRY='Italy' and (substringcount(GetFieldSelections(MonthYear),'Sep20, Oct20, Nov20, Dec20')),
round(sum({<BRAND=,PRODUCT=>}WEIGHT)))

Scenario 2(Not Working):

if  User is Selecting the MonthYear from Sep20 to Apr21 is not working for below selection:

=if(COUNTRY='Italy' and (substringcount(GetFieldSelections(MonthYear),'Sep20, Oct20, Nov20, Dec20,Jan21,Feb21,Mar21,Apr21')),
round(sum({<BRAND=,PRODUCT=>}WEIGHT)))

Kindly Help on resolving the Scenario 2 

Lakshminarayanan J
To help users find verified answers, please don't forget to use the "Accept as Solution" button
Labels (2)
1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

It's probably you are missing spaces between commas in your string after Dec20, this should fix it:

,'Sep20, Oct20, Nov20, Dec20, Jan21, Feb21, Mar21, Apr21'

But I would look for another way to do this that's not so string literal dependent.  Maybe:

(getselectedcount(MonthYear) = 8 and min(MonthYear) = 'Sep20' and max(MonthYear) = 'Apr21')

View solution in original post

1 Reply
stevejoyce
Specialist II
Specialist II

It's probably you are missing spaces between commas in your string after Dec20, this should fix it:

,'Sep20, Oct20, Nov20, Dec20, Jan21, Feb21, Mar21, Apr21'

But I would look for another way to do this that's not so string literal dependent.  Maybe:

(getselectedcount(MonthYear) = 8 and min(MonthYear) = 'Sep20' and max(MonthYear) = 'Apr21')