Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

amit_saini
Honored Contributor III

Script help!!!

Hi Folks ,

I'm having 6 qvds as below:

latencytime_inst1.qvd

latencytime_inst2.qvd

latencytime_inst3.qvd

Responetime_inst1.qvd

Responetime_inst2.qvd

Responetime_inst3.qvd

and across all these qvd's I'm having below table (Columns name are same )----> We can make this as cross table

I have to create a table chart like above , but based on filters below:

Please suggest how this could be possible.

Thanks,

AS

1 Solution

Accepted Solutions
amit_saini
Honored Contributor III

Re: Script help!!!

I Tried this :

Set vPath = D:\qvdev\PLM\Latency Report\#Source\Qvd;

For Each vName in 'latencytime_inst1_8080', 'latencytime_inst2_8070','latencytime_inst3_8060','responsetime_inst1_8080','responsetime_inst2_8070','responsetime_inst3_8060';

  For Each vFile in FileList(vPath & '\' & vName & '.qvd')

This is working fine .

Thanks,

AS

6 Replies
MVP
MVP

Re: Script help!!!

Like this, perhaps:

Set vPath = ..... path to your qvd files ....;

For Each vName in 'latencytime_', 'Responetime_'

  For Each vFile in FileList(vPath & '\' & vName & '*.qvd')

  T_Results:

  CrossTable(Location, Value)

  LOAD *

  FROM [$(vFile)] (qvd);

  Next

  Results:

  LOAD *,

  SubField('$(vFile)', '\', -1) As SourceFile

  Resident T_Results;

  DROP Table T_Results;

Next

The final Results table will have these fields: STDATE, Location, Value, SourceFile

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP
MVP

Re: Script help!!!

Try like:

Load

          *,

          SubField(FileBaseName(), '_',1) as Filter1,

          SubField(FileBaseName(), '_',2) as Filter2

From <> ;

amit_saini
Honored Contributor III

Re: Script help!!!

Hi Jonathan,

Thanks , but below are my qvd's

But after loading the script source file is showing me 2 qvds , it should show all qvds in list box. Please suggest why???

Thanks,

AS

amit_saini
Honored Contributor III

Re: Script help!!!

Below is script:

Set vPath = D:\qvdev\PLM\Latency Report\#Source\Qvd;

For Each vName in 'latencytime_*', 'responsetime_*'

  For Each vFile in FileList(vPath & '\' & vName & '*.qvd')

  T_Results:

  CrossTable(Location, Value)

  LOAD *

  FROM [$(vFile)] (qvd);

  Next

  Results:

  LOAD *,

  SubField('$(vFile)', '\', -1) As SourceFile

  Resident T_Results;

  DROP Table T_Results;

Next

amit_saini
Honored Contributor III

Re: Script help!!!

any suggestions????

amit_saini
Honored Contributor III

Re: Script help!!!

I Tried this :

Set vPath = D:\qvdev\PLM\Latency Report\#Source\Qvd;

For Each vName in 'latencytime_inst1_8080', 'latencytime_inst2_8070','latencytime_inst3_8060','responsetime_inst1_8080','responsetime_inst2_8070','responsetime_inst3_8060';

  For Each vFile in FileList(vPath & '\' & vName & '.qvd')

This is working fine .

Thanks,

AS