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

lET TRANSPORT_GE = 1.0; may i know how to save this filed into QVD ?

Hi All

In my QV doc , i have below script :-

lET TRANSPORT_GE = 1.0;

My question is how can i save the above in QVD.

So that when i change the value from 1.0 to 1.03 , it will appear the change in my QVD file.

As my another QV QVW file will read the QVD file , and i also want it show the changes.

In case not possible , may i know what is the work around ?

Paul

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Goto 'Load in line' tab and paste this code at the bottom,

FromQVD:

Load TRANSPORT_GE_ from $(vQVDPath)TRANSPORT_GE.qvd (qvd);

Let vTRANSPORT_GE_=peek('TRANSPORT_GE_','FromQVD');  

Then try your code to rerun.

View solution in original post

9 Replies
tresesco
MVP
MVP

Use INLINE load like:

Var:

Load Var Inline

[ Var

     1.0

];

Store Var Into <>;

// Then read the value from the table into a variable like:

Load Var From <QVD>;

Let TRANSPORT_GE=Peek('Var');   

Not applicable
Author

Hi Sir

Many thank for your help.

I create a inline load for TRANSPORT_GE_ , when i try partial reload for TRANSPORT_GE_ , it detected this field is not avaiable.

left join    (GE)

   

Load PART_NO_,

//    LIST_PRICE*(1-Discount)*TRANSPORT_GE_ as AFTER_DISCOUNT_ADD_TRANSPORT_,

    LIST_PRICE*(1-Discount)*$(TRANSPORT_GE) as AFTER_DISCOUNT_ADD_TRANSPORT

Resident GE;

Any advise on this ?

Paul

Not applicable
Author

Hi Sir

To test my QV doc , just need to copy the enclosed QV file into your note book  C:\ drive and create a folder

C:\GE\ 

tresesco
MVP
MVP

While you are storing the value in a table like :

TRANSPORT_GE_:

Load TRANSPORT_GE_ Inline
[ TRANSPORT_GE_
     1.03
]
;
store TRANSPORT_GE_ into $(vQVDPath)TRANSPORT_GE.qvd (qvd);

From QVD:

Load TRANSPORT_GE_ from $(vQVDPath)TRANSPORT_GE.qvd (qvd);

You have to take this into a variable like :

Let vTRANSPORT_GE_=peek('TRANSPORT_GE_');

Now you can use variable into your loads follow.

Not applicable
Author

Hi Tres

Thank you very much. I understand what you mean. But my issue is in my QVD generator , i need to perform a partial load on the below script. This is because i need to make use of the field name TRANSPORT_GE_  to get the AFTER_DISCOUNT_ADD_TRANSPORT_ ( now i cannot run this script , it will get error )

left join    (GE)

   

Load PART_NO_,

//    LIST_PRICE*(1-Discount)*TRANSPORT_GE_ as AFTER_DISCOUNT_ADD_TRANSPORT_,

    LIST_PRICE*(1-Discount)*$(TRANSPORT_GE) as AFTER_DISCOUNT_ADD_TRANSPORT

Resident GE;

tresesco
MVP
MVP

What do you mean by 'partial load' ? Not sure, because i don't see any Add/Replace keyword before your load statement (which is required to perform a partial realod). Can you post the error you are getting?

Not applicable
Author

Hi Tres

For you to see the error msg , you need to go to Tab = Partial load , go to below line of script , remove the // . and do a reload you should see the error. Now my question is how to make this line working.

//    LIST_PRICE*(1-Discount)*TRANSPORT_GE_ as AFTER_DISCOUNT_ADD_TRANSPORT_,

tresesco
MVP
MVP

Goto 'Load in line' tab and paste this code at the bottom,

FromQVD:

Load TRANSPORT_GE_ from $(vQVDPath)TRANSPORT_GE.qvd (qvd);

Let vTRANSPORT_GE_=peek('TRANSPORT_GE_','FromQVD');  

Then try your code to rerun.

Not applicable
Author

Hi Tres

Very powerful code. it work now. many thank.