Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Functions within Set Analysis

Hi,

I have a table that reports monthly figures. Some of the measures report a number of months behind.

I have a column for each measure which is a number. I would like to use ths number on my calculation.

I was using a number of IF statements e.g.

 

=

IF(ReportMonth=0,

     NUM(SUM( {$<Metric={'z'}>} Data),'0.00%'),

IF(ReportMonth=-1,

     NUM(SUM( {$<Metric={'z'},Month={$(vPreMonth)>} Data),'0.00%'),

IF(ReportMonth=-2,

   NUM(SUM( {$<Metric={'z'},Month={$(vPreMonth2)>} Data),'0.00%'))))

The problem with this is that I have to code for each possiblitly

What I would like to do is this:

  SUM( {$<Metric={'z'},Month={"$(=Date(AddMonths(vMonth,-1),'MMM'))"}>} Data)

But replace the -1 with 'ReportMonth'. This works with I hard code the number.

Any help would be great,

Cheers

Simon



0 Replies