Qlik Community

QlikView Connectors

Honored Contributor

Is it possible to extract a range of months from BEX Query using variables?

Hello everyone,

I'm having trouble with the extracting one year of data from a BEX Query.  The variable is 0CALMONTH so the range is from 201301 to 201312, but it only returns the garbage seen below.


The strange thing is that defining a range works perfectly fine for another BEX Query, but that this one.  Creating slices also doesn't work.  I've ended up creating a for each loop to extract the whole year, but I'm curious what the problem is with doing it the way it should be done.  The load script for the BEX Query is below:


Load *;

Select PseudoMDX (

Dimensions (

  [0BILL_DATE] (),

  [0BILL_NUM] (),

  [0BUS_AREA] (),

  [0COMP_CODE] (),

  [0MATERIAL] (),


  [0SOLD_TO] (),



  [ZPAY_DATE] (),

  [0CALMONTH] ()),

Measures (



  [00BAUFJVYS4EIU95UVZ67DNHU].[00BAUFJVYS4EIU95UVZ67FRCI], //UtilidadCobradaCuota

  [00BAUFJVYS4EIU95UVZ67DNHU].[00BAUFJVYS4EIU95UVZ67F8DU], //UtilidadCobradaReal

  [00BAUFJVYS4EIU95UVZ67DNHU].[00BAUFJVYS4EIU95UVZ67FL0Y]), //UtilidadCobradamenor a30 días

// Slices (

//  [0CALMONTH].[201312], [0CALMONTH].[201401]

//  ),

Variables (

  [ZSDVAR21] (I [0CALMONTH].[201301]:[0CALMONTH].[201312])),

From (ZFI_M02/ZFI_M02_Q0044));

Thanks for your help,


Tags (4)
Community Browser