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: 
Dayna
Creator II
Creator II

Set Analysis and Aggr

Hello,

I have an expression that I use to calculate the max value of a balance from the last inputted value over a period of time that works perfectly...


firstsortedvalue(DISTINCT aggr(min({<[BOM Chart - Date] = {"<=$(=date(only(today())+91))>=$(=date(only(today())-91))"}>} [BOM Chart - Balance]),[BOM Chart - Timescale],[BOM Chart - AutoNo]),-[BOM Chart - AutoNo])


However, what I need to add to this is to do this calculation for each site, i.e. Site A through to Site F. I was thinking of doing something like this:


(firstsortedvalue(DISTINCT aggr(min({<[BOM Chart - Site] = {'Site'},[BOM Chart - Date] = {"<=$(=date(only(today())+91))>=$(=date(only(today())-91))"}>} [BOM Chart - Balance]),[BOM Chart - Timescale],[BOM Chart - AutoNo]),-[BOM Chart - AutoNo])) +
(firstsortedvalue(DISTINCT aggr(min({<[BOM Chart - Site] = {'Site2'},[BOM Chart - Date] = {"<=$(=date(only(today())+91))>=$(=date(only(today())-91))"}>} [BOM Chart - Balance]),[BOM Chart - Timescale],[BOM Chart - AutoNo]),-[BOM Chart - AutoNo]))


But this doesn't work, infact, only specifying one site doesnt work.. After looking on the forums, I saw that someone had a similiar issue where Aggr and set analysis doesnt work.

If anyone has any other ideas on how I can perform this calculation for multiple sites, it would be appreciated!!!

Kind Regards,
Dayna Litherland

0 Replies