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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expression criteria by dates fields only-set analysis

hi,

lets say i have a model with 100 fields.

in one of my expression i need to count the days, for example i choose january and year 2011 i get 31.

but i want to count days ignoring any selection in  any fields except my dates field selections.

for example i want to calculate the average sales for a day in january.

so if product sold for 900 pieces in one day in january its should give me 900/31 average sales for a day, even i select the product

( this selection leave me with 1 day from january).

hope its clear.

thanks.

13 Replies
swuehl
MVP
MVP

D V,

could you please verify that you don't miss an equal sign? I think that it should be

=SUM({$<[$(=Concat({1<$Field-={'date', ‘month’, ‘year’, ‘week’}>}distinct $Field,']= ,[')&']=')>} Value)

With out that equal sign, the result will be like

=SUM({$<[Field1], [Field2], [Field3], [Field4]= >} Value)

so only the last field will be cleared.

Regards,

Stefan

IAMDV
Master II
Master II

Hi Stefan,

That’s correct! Logically, I need to have the “=” sign. Although it works on my system without the “=” sign. I am using QV9 with SR7.

Thanks - DV

Not applicable
Author

hi ,

thanks for all the answers.

the question is more general.

why set analysis is set to find what to choose and doesnt know from what to ignore.

the question is simple - give an expression that is depend on fields field1,field2.......and ignore the rest of the model fields.

for sure my selection in the fields its depened should be dynamic and constant.

hope it clear my question.

dt

swuehl
MVP
MVP

Well, have you tried D Vs expression?

=SUM({$<[$(=Concat({1<$Field-={'date', ‘month’, ‘year’, ‘week’}>}distinct $Field,']= ,[')&']=')>} Value)

Instead of the fields printed bold, you specify the fields you want still to be considered, but want all other fields to be cleared. Instead of "Value", you specify your field you want to sum its values.

It seems that we still miss something important here, so please post a small example and specify what you expect to see if you select specified values on specified fields.

Thanks,

Stefan