Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ignore selection in an Aggr function

Hi,

can someone assist me , i have the following expression i want it to ignore the year and month selection:

Where should i put the year and month dimension , ive been trying for long .

SUM((aggr(sum([Quantity On Hand])*sum([Unit Cost]),WareHouse,InventoryStockCode)))

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this

SUM((aggr(sum({<Year = ,Month = >}[Quantity On Hand])*sum({<Year = ,Month = >}[Unit Cost]),WareHouse,InventoryStockCode)))


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sunny_talwar

Just to be safe, I would add set analysis to the first Sum as well

Sum({<Year, Month>}Aggr((Sum({<Year, Month>}[Quantity On Hand])*Sum({<Year, Month>}[Unit Cost])), WareHouse, InventoryStockCode))

Not applicable
Author

Hi Sunny

Thanks your suggestion worked fine ....You are a star !!!!

Regards

Innocent

sunny_talwar

I am glad I was able to help, please close this thread if you got what you were looking for by marking correct and helpful answers. Qlik Community Tip: Marking Replies as Correct or Helpful

Thanks,

Sunny

hirenjadiya
Partner - Contributor III
Partner - Contributor III

Hi Sunny,

Thanks for the above solution. It helped me to ignore selection while doing AGGR() Function.

Regards,

Hiren Jadiya

lalita_sharma
Contributor III
Contributor III

Hi All

I have a similar expression where I want to ignore anything selected in Date filter. It doesn't seem to work.

Could you please help?

=IF(GetSelectedCount(Workstream)=0,
Aggr(only({$<[Workstream Id]={'$(vCalc_StatusPack_DefaultWorkstreamID)'},[KPI name]={3}, Date =>}[Workstream]),[Workstream],[Workstream Id],[Risk Id],[KPI name],Date),
Aggr(only({$<[KPI name]={3},Date =>}[Workstream]),[Workstream],[Workstream Id],[Risk Id],[KPI name],Date))

 

 

My data looks like below

Risk IdWorkstreamWorkstream IdKPI nameDate
-1103/09/2021
-1227/08/2021
R0041310/07/2021
R0071310/07/2021
-5103/09/2021
-5227/08/2021
R0275310/07/2021
R0285310/07/2021

 

I am trying to create a straight table like below

Risk IdWorkstreamWorkstream IdKPI nameDate
R0041310/07/2021
R0071310/07/2021
R0275310/07/2021
R0285310/07/2021

 

the expression is for Workstream column. I dont want the data in this table to be affected by date filter selection.