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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

question about the set analysis

Hi ,

I have a below table, and I would like to get the [amount] of the agency on the agency_contract_date, the expressions are not work when I use set analysis and IF for the calculation. please kindly refer to the dimention below and the attached qvw. could you please kindly advise? thanks a lot!

dimention:

=aggr(

Maxstring(if(agency_contract_date>=date('20120101','YYYYMMDD')

and agency_contract_date<date('20130101','YYYYMMDD'),agency))

,agent)

expresssion 1:(not work)

sum({$<transaction_date={$(max(agency_contract_date))}>}

amount)

expresssion 2:(not work)

SUM(if(transaction_date=max(agency_contract_date),

amount))

agencyagentleaderagency_contract_datetransaction_dateamount
1001800102011010120120301140
1001800102011010120120401150
1001700102011010120120301140
1001700102011010120120401150
1008800112012050120120501160
1008800112012050120120601170
1008800112012050120120701180
1002800201999110120120201170
1002800201999110120120301180
1002800201999110120120401190
1009800212012050120120501200
1009800212012050120120601210
1009800212012050120120701220
1010800312012060120120601800
4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attacthed qvw. Is that what you need? If not explain in more detail. Tell us what the result table should be.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks a lot Wassenaar, you result is almost near what I want, but can't fix the issue that i am facing.

Could you please advise why the below expression is not work using the below dimension?

Seems the "max(agency_contract_date)" is not the maxinum agency_contract_date of the agency but the maxinum agency_contract_date of the whole table.

dimension:

=aggr(

Maxstring(if(agency_contract_date>=date('20120101','YYYYMMDD')

and agency_contract_date<date('20130101','YYYYMMDD'),agency))

,agent)

expresssion 1:(not work)

sum({$<transaction_date={$(max(agency_contract_date))}>}

amount)

Sokkorn
Master
Master

Hi,

Your expression 1 should be like this

Sum({$<transaction_date={$(=Date(max(agency_contract_date),'YYYYMMDD'))}>} amount)

Regards,

Sokkorn

Not applicable
Author

Thanks Sokkorn, Please refer to my reply above.