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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

Range values should hold in variable

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.

Capture.PNG

- In button action itself i written for the variable to hold this value.

For your reference i'm attaching my qvw file.

28 Replies
Not applicable

swuehl,


Actually i didn't see your previous post and replied.But after use the latest expression, the corresponding lot is getting.

But i can't undestand the expression.

Can you please explain a bit detailed.If you do like that i may know what you had done.

Once again thanks for your reply.

swuehl
MVP
MVP

Sure,

=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))) &')'

has two parts, first builds the timestamp string:

timestamp(Min({<CaptureDateTime={">=$(=vStartDate& ' ' & vStartTime)<=$(=vEndDate & ' ' & vEndTime)"} >} LotStartDateTime),'MM-DD-YYYY hh:mm:ss')

(I think this should be clear, finding the min LotStartDate using a set expression to limit on certain CaptureDateTimes, then formatting).

Second part

& '('& FieldValue('LotNo',FieldIndex('LotStartDateTime',Min({<CaptureDateTime={">=$(=vStartDate& ' ' & vStartTime)<=$(=vEndDate & ' ' & vEndTime)"} >} LotStartDateTime))) &')'

is doing a lookup of the LotNo directly in your fields, I am using FieldIndex('Fieldname',Fieldvalue) to retrieve the index of the just found minimum LotStartDateTime (and hopefully QV will optimize the min search, because it's already performed once) and then input this to the FieldValue('FieldName',Index) function as second parameter.

The rest is just adding brackets around.

Hope this makes it clear,

Stefan

Not applicable

Swuehl,

Sorry for disturbing you again on the same post.

Please see the attached file

I have changed the data and it is not showing correct results as it is working with previous data.

Can you find what happened?

Thanks...

swuehl
MVP
MVP

I can't see any contained data in your qvw (no tables successfully loaded?)

Please check your load. You got two FROM statements in your load. I get an error message.

Not applicable

Ok Swuehl

This time you will found the correct attachment

Thanks

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Thanks a lot swuehl  I'll try and get back to you.

swuehl
MVP
MVP

Your capture date time is not formatted like 'MM-DD-YYYY hh:mm:ss' ,the format you used before and is used in the actions to select on field and in set expression.

Either format your field on load or change your action expressions.

Regards,

Stefan

Not applicable

Ok Swuehl,

Now how can i made that correct.

Do you have any suggestions?

Thanks..

swuehl
MVP
MVP

As already said (now I focus in formatting in load):

RangeData:

LOAD

timestamp(CaptureDateTime,'MM-DD-YYYY hh:mm:ss') as CaptureDateTime,

timestamp(LotStartDateTime,'MM-DD-YYYY hh:mm:ss') as LotStartDateTime,

LotNo,

Date(Floor(CaptureDateTime), 'MM-DD-YYYY') as DistinctCaptureDate

FROM

[..\2_QVDGenerator\QVD\HistoricalYears.qvd]

(qvd);

Not applicable

Swuehl,

I have changed my load staement with timestamps for all fields except LotNo and tested but i didn' t get exactly.that is why i posted again.

Please see once again.

Thanks...