Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create Global Variables from tables loading script

Hi,

I need a global variable that I can use as a "Reference Lines".

Can I create a variable in the loading script phase?
I need a the calculation of the   [TIMESTAMPEND]/ [RECORDCOUNT] for each record

LOAD  

  [VERSIONE] as versione_f,

  [RETEACCESSO] as reteAccesso_f,

  [ADNETWORK]  as adNetwork_f,

  [CLI_INDIVIDUATO] as CLI_Individuato_f,

  [MSISDN_INDIVIDUATO] as MSISDN_Individuato_f,

  [CLUSTER_INDIVIDUATO] as Cluster_Individuato_f,

  [TIMESTAMPSTART],

  [TIMESTAMPEND],

  date(Mid(TIMESTAMPSTART,1, 10)) as Data_inizio_f,

  date(mid(TIMESTAMPEND,1, 10)) as Data_fine_f,

  mid(TIMESTAMPSTART,12, 2) as Ora_inizio_f,

  mid(TIMESTAMPSTART,12, 12) as Orario_inizio_invio_f,

  mid(TIMESTAMPEND,12, 2)  as hour,

  mid(TIMESTAMPEND,12, 12) as Orario_fine_invio_f,

  [RECORDCOUNT] as TotalRequest

FROM [$(Loadworkpath)AdvHub_frequente.qvd]

(qvd);

2 Replies
Gysbert_Wassenaar

Calculate the values in the load script and add them in a new field:

LOAD 

  [VERSIONE] as versione_f,

  [RETEACCESSO] as reteAccesso_f,

  [ADNETWORK]  as adNetwork_f,

  [CLI_INDIVIDUATO] as CLI_Individuato_f,

  [MSISDN_INDIVIDUATO] as MSISDN_Individuato_f,

  [CLUSTER_INDIVIDUATO] as Cluster_Individuato_f,

  [TIMESTAMPSTART],

  [TIMESTAMPEND],

  date(Mid(TIMESTAMPSTART,1, 10)) as Data_inizio_f,

  date(mid(TIMESTAMPEND,1, 10)) as Data_fine_f,

  mid(TIMESTAMPSTART,12, 2) as Ora_inizio_f,

  mid(TIMESTAMPSTART,12, 12) as Orario_inizio_invio_f,

  mid(TIMESTAMPEND,12, 2)  as hour,

  mid(TIMESTAMPEND,12, 12) as Orario_fine_invio_f,

  [RECORDCOUNT] as TotalRequest,

  [TIMESTAMPEND] / [RECORDCOUNT] as NewField

FROM [$(Loadworkpath)AdvHub_frequente.qvd]

(qvd);


talk is cheap, supply exceeds demand
sunny_talwar

It can be done as shown by Gysbert‌, but note that this is going to break your optimized load. May be you don't have to worry about it, but if you have lot of data getting loaded from the qvd you might want to perform this division on the front end of the application or by taking a subset of data from this table in a resident table and save it as a separate table linked to the main table on some kind of key. I don't know you data well enough to guide you in detail, but just wanted to bring the issue of breaking optimized load.

http://www.quickintelligence.co.uk/qlikview-optimised-qvd-loads/

http://www.learnqlickview.com/qlikview-mapping-load-optimized-or-un-optimized/