daily pastebin goal
12%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SUB MBI_ConcatTables(vRoot,vSearchParam)
  2.  
  3. //Laddar in alla värden från ett antal QVD filer i en mapp till två kolumner
  4. //Om en sökparameter använs filtreras datasetet baserat på en WildMatch mot det man läst in
  5.  
  6.     if len('$(vSearchParam)')>0 then
  7.       set vSwitch = 1;
  8.     else
  9.       set vSwitch = 0;
  10.     end if
  11.  
  12.     for each file in filelist('$(vRoot)'&'*.qvd')
  13.    
  14.     switch $(vSwitch)
  15.     case 1
  16.         trace 'Loading filtered dataset...';
  17.  
  18.         Data:
  19.         LOAD * INLINE [
  20.         dmy
  21.         ];
  22.  
  23.         Data_tmp:      
  24.         crosstable(Field,Data,2)
  25.         load
  26.         1 as all,
  27.         2 as dummy,
  28.         *
  29.         from [$(file)](qvd);
  30.  
  31.        
  32.             Concatenate(Data)
  33.         Data_filtered:
  34.         LOAD '$(file)' as File,Data,Field Resident Data_tmp where ( WildMatch(Field,'$(vSearchParam)') or WildMatch(Data,'$(vSearchParam)'));
  35.         drop table Data_tmp; drop field dmy;
  36.  
  37.  
  38.     default
  39.  
  40.         Data:
  41.         crosstable(Field,Data)
  42.         load
  43.         1 as all,
  44.         *
  45.         from [$(file)](qvd);
  46.  
  47.     end switch
  48.  
  49.    
  50.     next file
  51.  
  52.      set vSwitch=''; //cleanup
  53.  
  54. END SUB
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top