Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

IF Function field in Set Analysis

Hey,

I need to apply date filter on expression in a table, which has values that are not connected with any CREATEDATETIME. So I need to apply this filter only on fields which are not null.Here is my set analysis which won't work.

sum ({<[$(=if(not isnull(ZpoGr.CREATEDDATETIME),ZpoGr.CREATEDDATETIME))]= {$(='">='&DATE(zpgCreateDT_From2) & '<=' &DATE(zpgCreateDT_To2) & '"')}>}InvOut.AMOUNTCUR)

Thanks for help

UPD I have problems only with the left part of the expression - the right one works correctly

8 Replies
Not applicable
Author

sum ({<

                     [$("=if(ZpoGr.CREATEDDATETIME<>' ',ZpoGr.CREATEDDATETIME)"]= {$(='">='&DATE(zpgCreateDT_From2) & '<=' &DATE(zpgCreateDT_To2) & '"')}>}InvOut.AMOUNTCUR)

Not applicable
Author

the same result

Sokkorn
Master
Master

Hi,

Can you try this set analysis and let me know the result

=Sum({$<[ZpoGr.CREATEDDATETIME] = {">=$(=Date([zpgCreateDT_From2]))<=$(=Date([zpgCreateDT_To2]))"} >} [InvOut.AMOUNTCUR])

Note: make sure you have same date format in field [ZpoGr.CREATEDDATETIME],[zpgCreateDT_From2] and [zpgCreateDT_To2]

Regards,

Sokkorn

Not applicable
Author

the problem is that I have to check if the value is not null, cause without this check the filter reduces all lines which have no CREATEDDATETIME even when the filters are empty

Sokkorn
Master
Master

Hi,

=Sum({$<[ZpoGr.CREATEDDATETIME] = {">=$(=Date([zpgCreateDT_From2]))<=$(=Date([zpgCreateDT_To2]))"},

[ZpoGr.CREATEDDATETIME] -= {$(=IsNull([ZpoGr.CREATEDDATETIME]))}

>} [InvOut.AMOUNTCUR])

Second line of set analysis above will exclude null value from your field. Let give it a try. If possible, attacched your sample att here.

Regards,

Sokkorn

Not applicable
Author

Something wrong with syntax.

Thanks for your attension, but we decided to find another way.

Sokkorn
Master
Master

Hi,

Any sample app? then we can easy to find a new solution.

Rgds,

Sokkorn

Not applicable
Author

unfortunately, now I have no permission to attach a file

Thank you