Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
gzboy008
Contributor
Contributor

different result I got between using "if" clause and set analysis

Dear Friends,

        It makes me a puzzle by this example case why I got different result in Qlikview by using "if" clause versus set analysis.

The first formula is using "if" clause, this is what I want.

 

sum

(if(transaction_date<=aggr(nodistinct maxstring(agency_contract_date),agent),amount

))

The second formula is using set analysis. The result is beyond my expectation, the result is different from the first formula. 

Sum

({< transaction_date = {"=transaction_date<=aggr(nodistinct maxstring(agency_contract_date),agent)"} >} amount

)

Can somebody illustrate to me why the result is different? How can I achieve the same result by using set analysis?

Thanks!

untitled.bmp

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached qvw for an explanation.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

See attached qvw for an explanation.


talk is cheap, supply exceeds demand
gzboy008
Contributor
Contributor
Author

I assigned a uniq_id to each and get the correct result.

Learnt a lot. Thanks so much~