Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Mr_Pearl
Creator II
Creator II

Qlik sense set analysis – failing when filter applied.

Below formula gives output works when user dont make any manual selection on "IncomingDate" field.

count({<IncomingDate = {'$(=only({<[Period]={'YTD'}>}PreviousYearCalculation))'}>} Quantity)

For “Period” as ‘YTD’, value in PreviousYearCalculation is

>=$(=YearStart(AddYears(max(IncomingDate),-1),0,7))<$(=date(makedate(year(max(IncomingDate))-1,month(max(IncomingDate)),day(vMaxIncomingDate))+1))

By default this is how above formula looks like:

count({<IncomingDate={">=1/7/2021<30/5/2022"}>} [Quantity])

When user apply “IncomingDate” filter we are getting “0” as value. If we apply filters on any other field, above formula works fine.

Why are we getting zero value when we apply filter on “IncomingDate” field? How do I overcome this issue?

Below formula (ignoring) field works, but this require me to exclude 100’s of field so this is not practically possible for me.

count({ 1 <field1=$::field1,field2=$::field2,IncomingDate = {'$(=only({<[Period]={'YTD'}>}PreviousYearCalculation))'}>} Quantity)

Any help will be greatly appreciated.

Labels (4)
1 Solution

Accepted Solutions
menta
Partner - Creator II
Partner - Creator II

You can duplicate the IncomingDate Field and use the nextone into the formula and the previous in filter. In you expression you need only to exclude the filter field

example

count({<IncomingDateNew={">=1/7/2021<30/5/2022"} , IncomingDate= >},([LOS(Min)])

View solution in original post

3 Replies
menta
Partner - Creator II
Partner - Creator II

You can duplicate the IncomingDate Field and use the nextone into the formula and the previous in filter. In you expression you need only to exclude the filter field

example

count({<IncomingDateNew={">=1/7/2021<30/5/2022"} , IncomingDate= >},([LOS(Min)])

Mr_Pearl
Creator II
Creator II
Author

@menta thank you for the reply. I tried that but still having same issue. Zero value when the duplicate field is selected.

Mr_Pearl
Creator II
Creator II
Author

found the issue. Filter i was using was "MonthName(IncomingDate)". For some reason this is causing the issue with the set analysis.

Thank you @menta for pointing me right direction. I created another field called "IncomingDate_MonthName" and used it in the filter. Also included this newly created field within the set analysis as @menta mentioned above.