Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
chriswain2
Creator
Creator

Aggr with Above() function

I have created an expression which does a running maximum using above(), so if the values of the underlying expression within a dimension are 1,1,3,2,4,3 the output will be 1,1,3,3,4,4 This is it:

RangeMax(
      above(
                sum(
                      aggr(
                          ceil(RangeMax(0,((sum(Hours)/$(vEfficiency))/(sum([5 Day Hours Capacity]))))*count( DISTINCT Machine))
                     ,[Machine Class],[Week Year])
                )
      ,0,NoOfRows
())
)
What I want to do is to use aggr to get an overall sum within each week for all machine classes calculated indicidually when I take away the dimension [Machine Class] from the straight table. I thought I could just put sum(aggr round the whole expression but it doesn't work. The above() part does not seem to work when I take away the dimension. Any ideas please?

4 Replies
Gysbert_Wassenaar

If you remove the dimension then there are no rows so NoOfRows() has no value. Perhaps you can post a qlikview document that explains what you're trying to calculate.


talk is cheap, supply exceeds demand
chriswain2
Creator
Creator
Author

Thanks Gysbert. The rows are on the [Week Year] field and I am only taking away the [Machine Class] dimension so there should still be rows. When I do that I want the same expression calculated separately but for each Machine Class. It works if I remove the Machine Class dimension and only select one Machine Class. So I thought I could do sum(aggr(....., [Machine Class]) but it does not give the correct answer.

I will try and post the qvw but I will have to get approval due to confidential information.

Gysbert_Wassenaar

This should help you get permission: Preparing examples for Upload - Reduction and Data Scrambling


talk is cheap, supply exceeds demand
chriswain2
Creator
Creator
Author

Thanks, file attached. If it appears blank click CTRL SHIFT S. I want to take off the first dimension and have 11th May to be the sum of 7+3+9+.......  = 92 etc