# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Highlighted
Not applicable

## Limit by two dimentions in an expression

Hi,

New to QV so I hope I worded this question correctly -

I want to limit sales by month. (I have a fat calendar table that holds all possible days, weeks, quarters, months, years for the period)

This works:

=sum({\$<month_no_id = {\$(#=Only(month_no_id ))},day=,calendar_date=, week_no_id=,week_no=>} sale_cost_value)

Each sale can have a different no of sales charges, and I need to limit by one of the charges within the month

This works to limit the sales type

 - sum({}  [sales_cost_value]))

But something like this doesn't

sum({\$<month_no_id = {\$(#=Only(month_no_id ))},day=,calendar_date=, week_no_id=,week_no=>} sum({<sales_cost_id={ '4'}>}  [sales_cost_value]))

Is there any way I can combine both restrictions in an expression or is there another way?

Tags (3)
1 Solution

Accepted Solutions
Honored Contributor

## Re: Limit by two dimentions in an expression

Hi Stefan,

SOmething like:

sum({\$<month_no_id = {\$(#=Only(month_no_id ))},day=,calendar_date=, week_no_id=,week_no=,sales_cost_id={ '4'}>} [sales_cost_value])

should do the trick

3 Replies
Honored Contributor

## Re: Limit by two dimentions in an expression

Hi Stefan,

SOmething like:

sum({\$<month_no_id = {\$(#=Only(month_no_id ))},day=,calendar_date=, week_no_id=,week_no=,sales_cost_id={ '4'}>} [sales_cost_value])

should do the trick

Not applicable

## Re: Limit by two dimentions in an expression

Thanks very much Adam, that issue killed my morning! Very much appreciated.

Honored Contributor

## Re: Limit by two dimentions in an expression

Hi Stefan,

Not a problem at all, and don't worry, Set Analysis kills most of my time at the moment!

Kind regards