Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
- In my sheet i've four inputboxes. First 2 inputboxes are able to choose date and time and when i click the button the applicaton holds data with in the range.
- Now, i want to hold one field value in 3rd inputbox. But the input box not able to hold it, for eg as shown in the below image of 2nd textobject value should hold in 3rd inutbox.
- In button action itself i written for the variable to hold this value.
For your reference i'm attaching my qvw file.
I think we cannot use the FieldIndex, FieldValue approach then.
Try attached, I changed the set variable actions like:
=timestamp(Min({<CaptureDateTime={">=$(=vStartDate& ' ' & vStartTime)<=$(=vEndDate & ' ' & vEndTime)"} >} LotStartDateTime),'MM-DD-YYYY hh:mm:ss')
& '('&
concat(aggr(if(LotStartDateTime=Min(total {<CaptureDateTime={">=$(=vStartDate& ' ' & vStartTime)<=$(=vEndDate & ' ' & vEndTime)"} >} LotStartDateTime),LotNo),LotStartDateTime))
&')'
Regards,
Stefan
Hi Jagan,
I am not sure what you are trying to achieve. To me, it seems that your button is workin.
If I change the values for the Start Lot / End Lot input boxes and then press the button, the variables are set to the value you show in the bottom text box (i.e. the first value of your concatenated list), that's what the expression of your text box and the two identical set variable actions (besides the variable name) of the button say, isn't it?
So I can't see an error, unless you are trying to achieve something else.
Regards,
Stefan
Hi Swuehl,
I am also having the same problem
The problem is not about the range appy.The inputbox doesn't show the value with in the range default. If you click on two times the same button it is showing the minimum value with in the range and maxvalue with in the range.
Why it is happening i don't know.
Can you provide the solution for this?
Thanks..
Sorry, I don't just get the point:
You are selecting CaptureDateTime in the first two input boxes, right?
This will lead to implicitely selected list of distinct LotStartDateTime values, the list is printed in the first text box.
Please note that these LotStartDateTime don't necessarile fall inbetween the selected CaptureDateTime.
Then, on the same button events, you set two variables: vLotStart and vLotEnd to the same value (which is the first value in the just mentioned list. This seems to work, regardless of how many times I click the button.
(I am just using QV 10 SR2).
In the posted example, I see :
06-26-2011 23:26:42(B00BST3)
in both input boxes for Lot start and end selected.
(and if you want to select the last value in above mentioned list for the end lot date / vLotEnd variable, I think you need to replace the last subfield parameter 1 to -1 :
=SubField(Concat(DISTINCT Timestamp(LotStartDateTime,'MM-DD-YYYY hh:mm:ss')& '(' & LotNo & ')' ,','),',',-1)
Regards,
Stefan
Hi Swuehl,
Please change the variables value like this
vLotStart=SubField(Min(Timestamp(LotStartDateTime,'MM-DD-YYYY hh:mm:ss')) & '(' & Minstring(LotNo) & ')',',',1)
vLotEnd=SubField(Max(Timestamp(LotStartDateTime,'MM-DD-YYYY hh:mm:ss')) & '(' & Maxstring(LotNo) & ')',',',1)
This is is my crrent selection
After applying this range
The first inputbox(Start Lot) showing the garbage value (like )default and the selcond inputbox(End Lot) showing the garabage value(like
) But actually there it needs to show the values like
,
.But if i click again that value is showing.
Please do the changes and observe why it happens.
Let me know what is the problem happening.
Thanks..
I see.
Not sure why this happens.
Maybe a race condition between the first action (set selection) and the two actions setting the variable based on the selections range?
(Well, I don't really think so, but I tried using two buttons, one for the set selection in field, one for the two variable assignments, and it worked in one path. I then tried to add a macro with a sleep within the set selection in field and the two other actions, but with no success. Would be IMHO bad design of the trigger actions anyway, given that you could assign a priority / order).
But here's a at least workaround: Apply the set also for the Capturedate as set expression to your min/max functions like:
=SubField(Min({<CaptureDateTime={">=$(=vStartDate& ' ' & vStartTime)<=$(=vEndDate & ' ' & vEndTime)"} >}Timestamp(LotStartDateTime,'MM-DD-YYYY hh:mm:ss'))
& '(' & Minstring({<CaptureDateTime={">=$(=vStartDate& ' ' & vStartTime)<=$(=vEndDate & ' ' & vEndTime)"} >} LotNo) & ')',',',1)
Besides that, I am not sure if your Minstring is such a good idea in terms of performance and results, are you sure you always get the corresponding LotNo to the min LotStartDate returned (or maybe just the minstring (alphabetical ordered) )? And do you still need the subfield when using then min-functions?
Regards,
Stefan
Me again,
regarding my last comment, I would probably try to get the timestamp formatting stuff out of the min functions and do the formatting on the results only. Then, as mentioned, I think I would try to use the results from the min to get a corresponding value for the LotNo.
Maybe like
=timestamp(Min({<CaptureDateTime={">=$(=vStartDate& ' ' & vStartTime)<=$(=vEndDate & ' ' & vEndTime)"} >} LotStartDateTime),'MM-DD-YYYY hh:mm:ss')
& '('& FieldValue('LotNo',FieldIndex('LotStartDateTime',Min({<CaptureDateTime={">=$(=vStartDate& ' ' & vStartTime)<=$(=vEndDate & ' ' & vEndTime)"} >} LotStartDateTime))) &')'
Seems to perform much better also (at least at my site).
Regards,
Stefan
Swuehl,
Thanks for your reply
I need to display LotstartDateTime along with Lotno that is why i use concatenation there.
Comming to MinString,If am not using ,i am getting ()(emty brackets in the place of LotNo)Because it is not able to find Min(LotNo) and the field is of string type.I know i may not get the LotstartDateTime corresponding Lotno.
Comming to subfield,If i dont use,I am getting all the values in the same line as default.
Is there any solutions to overcome the above
Any way thans for your reply.
Swuehl,
Thanks for your Setanalysis expression.
But how can i get the corresponding Min and Max LotNo
If you had any solution please share with me.
Thanks..
Well, the expression of my last post should result in the full string (timestamp + LotNo), where I lookup the corresponding LotNo to the found minimum LotStartDateTime. I think this should be correct, don't you?