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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

select maximum week in a sheet??

Hello,

I have a field named plan_week. I want to select the maximum plan_week in a sheet by default. I have tried maxstring(plan_week) in the select field trigger but its not working. Can some one help

Arif

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Make sure that in search string (OnActive Trigger of sheet) you type as =maxstring(Plan_Week).

   I tried this and it works fine at my side.

  

Regards,

Kaushik Solanki

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

View solution in original post

10 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Try max(Plan_Week)

Regards,

Kaushik Solanki

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

when i try to enter manually the lastest week 2011W22 without quotes in the search string field, it works. when i try the formula maxstring(Plan_Week) in the search string, it does not work. It also does not work if i put quotes '' around 2011W22 like '2011W22'.

I have tried max as well, but since the week is in string format, the max does not work. even though in list box, if use maxstring, it correctly gives the maximum week. however, it is not working in the select field trigger

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Did you try this.

   maxstring('Plan_Week')

Regards,

Kaushik Solanki

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

actually the problem is not with the formula. the formula is working perfectly if i put it in a list box. it is returning the maximum week. however, this formula is not working in the search field of select trigger. actually this formula does return latest week, but for some reasons...the search string field is not working with it. as i hav said...if i enter '2011W22', then it does not work, and if i enter 2011W22, then it works.

soo may be, the returned string is somehow with quotes ..or i am not sure.

max() is not working and it returns an error for some reason i dont know. maxstring works fine though.

Arif

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   I didnt understand what you said.

   Can you please explain in detail what are you doing and what you want with example.

Regards,

kaushik Solanki

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

okay, let me rephrase it. I have a sheet, where i hav a filter with the week field (Plan_Week). I want that when i enter this sheet, the latest week is selected by default.

I tried to accomplish this by using triggers of sheet. I used the select field trigger. I selected Plan_Week in the field..and in the search string..i put Maxstring(Plan_Week).

Now logically, when i enter this sheet, it should select the maximum week. but it is not working. i thought there might be an issue with this formula, so i tried this formula in a seperate listbox expression, and it is accurately returning 2011W22 as a maximum week.

Now i tried to enter 2011W22 manually in the search string field of the  trigger, and it works correctly with this.

Then why is it that it is not working with  Maxstring(Plan_Week) even though this formula is working correctly, which i hav verified in another list box expression.

let me know if you need more informaiton

Arif

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Make sure that in search string (OnActive Trigger of sheet) you type as =maxstring(Plan_Week).

   I tried this and it works fine at my side.

  

Regards,

Kaushik Solanki

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

yes, in the search field of the select in field trigger in on activate sheet, i am wrtiting this, but it is not working for me.

Arif

Not applicable
Author

okay it worked now. Actually i had to put = before the expression in the search string field. Thanks a lot for your time and help

Arif