Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Set Analysis Headache!

Hi,

I have a weird problem that has been troubling me for a few days now. My output is to show the current month’s totals to the previous months, as well as the current month from the previous year. If you see in the attached example, I have selected Dec 2012 from the YEAR and MONTH Listboxes. The values for the selected month show without any problems BUT I can’t see the previous month and current month previous year's totals.

I’m using set analysis to get these values and control the months using variables (shown on the side of the table as well).

This is how I get my values and the variables:

Current Month: SUM({$<MonthDate={'$(vMonth)'}>} OperationalTrendTotal)

Previous Month: SUM({$<MonthDate={'$(vPreviousMonth)'}>} OperationalTrendTotal)

Current Month Previous Year: =SUM({$<MonthDate={'$(vPreviousYearCurrentMonth)'}>} OperationalTrendTotal)

vMonth =Date(MonthDate, 'YYYY-MM-DD')

vPreviousMonth =Date(AddMonths(MonthDate,-1), 'YYYY-MM-DD')

vPreviousYearCurrentMonth =Date(AddMonths(MonthDate,-12), 'YYYY-MM-DD')

Tags (1)
1 Solution

Accepted Solutions

Re: Set Analysis Headache!

Hi,

     For previous month try this.

     SUM({$<MonthDate={'$(vPreviousMonth)'},Year = , Month =>} OperationalTrendTotal)

     When ever you are trying to get the data for against the selection, you must remove the selection as I have shown in above expression.

Regards,

Kaushik Solanki

2 Replies

Re: Set Analysis Headache!

Hi,

     For previous month try this.

     SUM({$<MonthDate={'$(vPreviousMonth)'},Year = , Month =>} OperationalTrendTotal)

     When ever you are trying to get the data for against the selection, you must remove the selection as I have shown in above expression.

Regards,

Kaushik Solanki

Not applicable

Re: Set Analysis Headache!

Hi Kaushik,

Thank you, that was correct!

Community Browser