Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
rammarthi
Contributor

How to use single month column with variables in Set Analysis

Hi,

I have a month column that is defined by Month(Report_dt) as RPT MONTH, which is in the format 'MMM', i.e., 'Jul','Aug', etc.,

I got the latest month into a variable with the help of Peek function as below:

RPT_MNTH:

LOAD

Max([RPT MONTH]) as MAX_RPT_MNTH

Resident RPT;

LET vMaxRPTMnth = Peek('MAX_RPT_MNTH',0,'RPT MONTH');

Now $(vMaxRPTMnth) has a value of 8 for latest month being 'Aug'

I wanted to use this variable in set analysis as below:

Sum({<[RPT MONTH] = {'$(vMaxRPTMnth)'}>}Sales)

But this equation is giving out 0.

I dont want another Month_Num variable/ field having 7,8 for Jul and Aug.

Help appreciated in advance.

Thank You

Ram Marthi

1 Reply

Re: How to use single month column with variables in Set Analysis

Change to this may be

RPT_MNTH:

LOAD MaxString([RPT MONTH]) as MAX_RPT_MNTH

Resident RPT;