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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis give strange output

If I tried to change the if statement into set analysis is give  different output

Sum(if([Posting Date] >=FromDate and [Posting Date] <= ToDate,Opn_Pur_TXN))

output-538582

sum({<[Posting Date]={'>=$(=FromDate)'},[Posting Date]={'<=$(=ToDate)'}>}Opn_Pur_TXN)

output-1386261

but I remove

[Posting Date]={'<=$(=ToDate)'

this expression output of If statement is same as qlikview I.e. 538582

what's wrong??

1 Solution

Accepted Solutions
sunny_talwar

Try this instead and see if it matches the output from if or not

Sum({<[Posting Date]={">=$(=FromDate)<=$(=ToDate)"}>}Opn_Pur_TXN)

View solution in original post

7 Replies
sunny_talwar

Try this instead and see if it matches the output from if or not

Sum({<[Posting Date]={">=$(=FromDate)<=$(=ToDate)"}>}Opn_Pur_TXN)

PrashantSangle

Hi,

Try below

sum({<[Posting Date]={">=$(FromDate)"},[Posting Date]={"<=$(ToDate)"}>}Opn_Pur_TXN)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Maybe you should put if statement before sum statement.

Try this:

if([Posting Date] >=FromDate and [Posting Date] <= ToDate, Sum(Opn_Pur_TXN))

Not applicable
Author

when u remove [Posting Date]={'<=$(=ToDate)' it gives same output

possible reason can be todate would be the max(date) of the application.in this case result set will be correct.

If any other scenario give more details about dates

awhitfield
Partner - Champion
Partner - Champion

Hi Shweta,

try:

=Sum({< PostingDate = {'>=$(=FromDate)<=$(=ToDate)'} >} Opn_Pur_TXN)

HTH Andy

Not applicable
Author

thanks sunindia its helps

sunny_talwar

Awesome

Wasn't sure if it is going to give you the correct result or not, but I am glad it worked.

Sunny