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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
arusanah
Creator II
Creator II

Set Analysis not working

Hi Friends ,

I'm writing two expression one with simple sum(if()) and other one using set Analysis . both are giving me different answers .

sum(if(CASH_DATE<=[Snapshot Date],CASH_AMOUNT,0)) --gives me correct number

Sum({< CASH_DATE={"<= $([Snapshot Date])"}>}  CASH_AMOUNT)
-- take my numbers off

Please help me find out error with my set expression.

Any help is greatly appreciated!

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

Hi,

try this:

Sum({< CASH_DATE={"<=$(=[Snapshot Date])"}>}  CASH_AMOUNT)

View solution in original post

5 Replies
YoussefBelloum
Champion
Champion

Hi,

try this:

Sum({< CASH_DATE={"<=$(=[Snapshot Date])"}>}  CASH_AMOUNT)

arusanah
Creator II
Creator II
Author

Thank you Youssef ,whit above expression I need to make selection on snapshot filter to see numbers . I tried to update above expression to see max snapshot date data

if(isnull(getfieldselections([Snapshot Date])),Sum({< CASH_DATE={"=max([Snapshot Date])"}>}  CASH_AMOUNT),

Sum({<{"<=$(=[Snapshot Date])"}>}  CASH_AMOUNT))

but this shows sum of all transactions and not just max date when nothing is selected .

Chanty4u
MVP
MVP

may be this?

if(isnull(getfieldselections([Snapshot Date])),Sum({< CASH_DATE={"$(=max([Snapshot Date]))"}>}  CASH_AMOUNT),

Sum({<{"<=$(=[Snapshot Date])"}>}  CASH_AMOUNT))

arusanah
Creator II
Creator II
Author

Thanks Chanty But this doesn't work either , already tried

Chanty4u
MVP
MVP

try

CASH_DATE= {'$(=Max([Snapshot Date]))'}


or


CASH_DATE= {'$(=Max([Snapshot Date]))'}



or


CASH_DATE= {'$(=date(max([Snapshot Date])))'}