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

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text Box Expression

Hi,

I am new to QlikView and was wondering if anyone can help with the following text box expression:-

It currently it reads "Highest time spent on Vacation with 186 hours mainly due to JSmith with 186"

What I would like it to read is the end 186 hours by the hours of JSmith which should be 57.5 hours (there actual monthly hours) so the last line of the code would need to be changed from AGS_hours to ??????, (AGE_hours by the AGS_StaffCode

 

='Highest time spent on ' & FirstSortedValue(AGS_Description1,-Aggr(sum({$}AGS_Hours),AGS_Description1))

& ' with ' & sum({<AGS_Description1={'$(=FirstSortedValue(AGS_Description1,-Aggr(sum({$}AGS_Hours),AGS_Description1)))'}>} AGS_Hours)

&' hours mainly due to ' & FirstSortedValue(AGS_StaffCode,-aggr(sum({<AGS_Description1={'$(=FirstSortedValue(AGS_Description1,-Aggr(sum({$}AGS_Hours),AGS_Description1)))'}>} AGS_Hours),AGS_StaffCode))

&' with ' & sum({<AGS_Description1={'$(=FirstSortedValue(AGS_Description1,-Aggr(sum({$}AGS_Hours),AGS_Description1)))'} >} AGS_Hours)

Heres hoping someone can help me,

Thanks Claire

Text Expression Box.bmp

1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Instead of your last sum(), try:

max(

aggr(sum({<AGS_Description1={'$(=FirstSortedValue(AGS_Description1,-Aggr(sum({$}AGS_Hours),AGS_Description1)))'}>} AGS_Hours),AGS_StaffCode)

)

View solution in original post

2 Replies
swuehl
Champion III
Champion III

Instead of your last sum(), try:

max(

aggr(sum({<AGS_Description1={'$(=FirstSortedValue(AGS_Description1,-Aggr(sum({$}AGS_Hours),AGS_Description1)))'}>} AGS_Hours),AGS_StaffCode)

)

Not applicable
Author

Thank you very much it works perfectly