Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script is not working properly

Hello,

Here i'm attaching  one zip file it consits of one qvw file and one qvd file.

Ok coming to my task. I developed my application with more than than 300 fields. Now for each field i want to catch min an max values and also i'm creating dummy fields for this result. After that i'm making input fields for min and max fields.

I developed script in two ways:

1) Quick load for min and max

2) Slow load for min and max

In the first script i'm not able to get accurate values for min and max. In the second script i'm able to get accurate values for dummy fields.

Can any one help me how to solve this problem.

For more information go through the enclosed qvw file.

10 Replies
Not applicable
Author

Qlikvie guru's  please help me on this. I think what i explained in previous post is clear if not ask me..

Miguel_Angel_Baeyens

Jacq,

The script loads fine at a first glance. Which values should be correct so we can check whether the reload is taking the correct values from the QVD file?

Regards,

Miguel

EDIT: The part marked as "slow" is concatenating tables, so that's unlikely you get proper values where TakeOver, MaxTakeOver and so are shared between two tables.

Not applicable
Author

Miguel

The zip file which i've given you have loaded with only 3 fields(i.e.,BCButtterflyTimeA,BCRobotTimeA,BCRobotVacA). The Min and Max values are displayed in the text box but the values are different in the generated fields i.e MinTakeOver, MaxTakeOver,MinTakeOver1, MaxTakeOver1.

llauses243
Creator III
Creator III

Hi jacq,

This is my offer, pls to see image attached

Good luck, Luis

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Jacq,

You are trying to get the min/max values by using the load fieldvalues() technique for speed. Good idea, but there are a some problems in your script.

1. The test

While Len(FieldValue('BCRobotTimeA', IterNo())) > 0

won't work because you do indeed have a zero length values in your data. I think Luis already pointed this out. I think a better way to control the loop is:

AutoGenerate(FieldValueCount('BCRobotVacA'))

2. When you load the fieldvalue, you name the new field same as the field you are loading. While I can't say for sure that is a problem, it seems illogical and potentially problematic.

3. The INPUTFIELD statement should be specified only once in your script.

Try the script below repeated for each field. I'm using preceding load so there is no need to create and drop a temp table.

Max_TakeOver:

LOAD  *, MinTakeOver as MinTakeOver1, MaxTakeOver as MaxTakeOver1;

LOAD 'BCButtterflyTimeA' as TakeOver,

max(X) as MaxTakeOver,

min(X) as MinTakeOver

;

LOAD FieldValue('BCButtterflyTimeA', recno()) as X

AutoGenerate(FieldValueCount('BCButtterflyTimeA'))

;

-Rob

http://robwunderlich.com

Not applicable
Author

Thanx  Luis and Rob.. I'll check and get back to you once i reach my office.

Not applicable
Author

ya i'm getting accurate values..But when i use updated qvd file. The input fields are holding the previous qvd file data only. The input fields are not reset to initial value.

For your reference i'm attaching one zip file with two qvd files. Load the application by changing the names of qvd file in editscript and see the result.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What you are seeing is expected behavior. Input Field values survive reload by design. The only way I know to automatically reset them is with a macro as discussed in other threads. Perhaps someone else has an idea as to how they can be reset in script.

-Rob

Not applicable
Author

Rob Wunderlich

Yes you are right.. I have gone through few threads in community. This thread has given me the details about input field functionality. But i'm not able to find the solution for my problem. If possible can you please check.