Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to have the Max RowNo from an expression available for all rows?

The below provides the RowNo for the latest retrieved value in the system.

// expression 1:

= if(max(retrieved) = max(TOTAL retrieved), RowNo(),0)

My impression is that it would be simple to have that RowNo available on all rows by wrapping the above expression in MAX, it does not work. 

// expression 2:

= MAX(   if(max(retrieved) = max(TOTAL retrieved), RowNo(),0)   )

Does anyone see what I am doing wrong in this very simple expression?

Simply need to be able to have that max RowNo from the first expression available on every for another expression.

Thanks for any assistance....

D

34 Replies
Not applicable
Author

Stefan,

Got a chance to take a look at this this afternoon and read your mail slowly. 

It seemed the thing you were recommending that I did not grasp earlier was simply to move the load of my customdimension to the front of the load script.   I made that change and sure enough, it worked, now my row references work w/ aggr for that case and in general, excellent.....

Thanks for repointing out the fact that moving the dimension load to the beginning of the load script may be all that is needed, very sweet and simple.

D

Not applicable
Author

Stefan,

My prior dialog indicates things worked.  There was an error in the data at that point.  The data was corrected and when I reloaded, the same issue appeared again.  I looked at the sort of the dimension in the table and indeed it is now sorted correctly but the answer is still not expected:

This expression gives me the rowno for YrWk=2012-5 as 44 which is correct.

=if(YrWk='2012-5', RowNo(),0)                                                    // gives me 44 for that row

This expression that makes that number available on all rows gives an incorrect answer of 36 now, you see what I am doing wrong:

=Max(TOTAL aggr(NODISTINCT if(YrWk='2012-5', RowNo(),0)   ,YrWk)  )  

swuehl
MVP
MVP

I can't really see anything wrong. If possible, you could upload your sample again, so I can look at the raw data.

Not applicable
Author

Stefan,

I believe this is working in the general case.  I have input boxes that link to expressions and regardless of the values used, works fine.

I believe the issue occurrs when Filtering is done.  This did not impact the last current row but does impact this expression.  Any way around it, the following still gives different answers if a selection filter is applied?

=Max({1} TOTAL aggr(NODISTINCT if(YrWk='2012-6', RowNo(),0)   ,YrWk)  ) 

swuehl
MVP
MVP

try this

=Max({1} TOTAL aggr(NODISTINCT if(only({1} YrWk)='2012-6', RowNo(),0)   ,YrWk)  )

Not applicable
Author

Yes............. Excellent, thanks....

Not applicable
Author

Stefan,

I put the expression in a variable and was trying to use on each row.  The interesting thing is that it does not allow me to use in basic math, even things such as:

=$(StartBurnDownRowV)+2

Do you see what I am missing?  I have used in calcs before, like the LastCurrentRow calc. 

Thanks,

D

swuehl
MVP
MVP

But you get the correct number in each row when using the expression without adding some constant?

=$(StartBurnDownRowV)

Any difference when using in a textbox?

Not applicable
Author

Stefan

Strange.

vStartBurndownRowV=45

This correctly calculates 55i:

=10+$(vStartBurndownRowV)

This incorrectly calculates 45:

=$(vStartBurndownRowV)+10

This gives me no answer:

=($(vStartBurndownRowV))+10

I must be missing something… Of course, I am trying to use the field with a calc like below for example:

(

If(RowNo()=$(vStartBurndownRowV), $(vOpenErrorsTbaTbc),

If(RowNo()>$(vStartBurndownRow), ABOVE( $(vOpenErrorsTbaTbc), RowNo()-$(vStartBurndownRow)) // make variable when startburndown row calc issue resolved

))

)

swuehl
MVP
MVP

Sorry, no idea yet.

Maybe you should open a new thread, so you get more attention on this new, unresolved problem from the community members.

Have a nice weekend,

Stefan