Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
WE ARE LISTENING! New Navigation for Qlik Community, Sept. 26: TELL ME MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
andy70018
Partner - Contributor III
Partner - Contributor III

Remove date field from set analysis

Hi all

Count({$<adatefield = >} ... something to count)

I want to count a field but removing the selection of adatefield. If I try this with other field types (string, IDs etc) it works fine and selection is ignored, but not with date fields.

Can anyone help here?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

It seems that you are using master item and not a direct expression in chart. Master Item is being treated differently in set analysis. To handle this - you can create a new field in the script with desired date format.

 

Though I am not very sure if this master item behavior is by-design or a bug.

View solution in original post

10 Replies
tresesco
MVP
MVP

Field types (string, IDs etc) can't be a deciding factor, it has to be something else. It could be that another date field is affecting the scope of your targeted date field or there could be another function being used in the expression where the date field reference is there. If you could share the actual expression you have - we could have a look and try help find that out.

andy70018
Partner - Contributor III
Partner - Contributor III
Author

this is the original expression:

Count({$<pen.wiedervorlage = >} pen.pen_id)

there is no other selection made. But if pen.wiedervorlage (a date field) is selected, the filter is (incorrectly) applied.

tresesco
MVP
MVP

You mean - your count expression produce different results when you have just no selection and has selection only in that date field? That's something that should not be. Could you share a screen shot or sample showing the issue? 

 

 

andy70018
Partner - Contributor III
Partner - Contributor III
Author

correct. I just reproduced the case in a testing environment and the problem occurs when the date in the filter is formatted to e.g. date(...). If the raw field is used in the filter than it works. 

Do you have any idea how to handle that? The field of course can also be selected e.g. in a table not just in a filter pane and there may be also another formatting expression.

tresesco
MVP
MVP

Even if you are using  formatting date(), it should not affect unless you are using a different date field in set analysis and filter. Without screenshot/sample it is becoming harder to guess and suggest.

andy70018
Partner - Contributor III
Partner - Contributor III
Author

Totally agree with you. As ony 3 screenshots are allowed here you see the situation as it works just in a sample app. I use the table to filter on PAT_ID and the counter remains at 3 different PAT_IDs.

andy70018
Partner - Contributor III
Partner - Contributor III
Author

now the same but with the formatted date in PAT_ID and the filter is ignored no more.

andy70018
Partner - Contributor III
Partner - Contributor III
Author

sorry, I wrote filter on PAT_ID. of course the filter is on PAT_IN

tresesco
MVP
MVP

It seems that you are using master item and not a direct expression in chart. Master Item is being treated differently in set analysis. To handle this - you can create a new field in the script with desired date format.

 

Though I am not very sure if this master item behavior is by-design or a bug.