Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

vikasmahajan
Honored Contributor III

U R G E N T - Set Analysis Help required

Dear All

I have following expression for calculating sales as per user selected month and year ,

I want to display same set of expression for last year as per user selected month and year  dynamically.

(SUM({$<FiscalYear={$(=max(FiscalYear))}>}[Sales Invoice Qty])

-

SUM({$<FiscalYear={$(=max(FiscalYear))}>}[Sales Return Qty])

)/1000

Thanks in advance

Vikas

1 Solution

Accepted Solutions
vikasmahajan
Honored Contributor III

Re: U R G E N T - Set Analysis Help required

Thanks to all

Finally resolve with following link

http://community.qlik.com/message/313514#313514

Vikas

15 Replies
MVP
MVP

Re: U R G E N T - Set Analysis Help required

Have you tried this?:

(SUM({$<FiscalYear={$(=(max(FiscalYear)-1))}>}[Sales Invoice Qty])

-

SUM({$<FiscalYear={$(=(max(FiscalYear)-1))}>}[Sales Return Qty])

)/1000

vikasmahajan
Honored Contributor III

Re: U R G E N T - Set Analysis Help required

Hello

Thanks For Immediate reply I have try the same but unfortunately I am not getting results .

any idea ?

Vikas

MVP
MVP

Re: U R G E N T - Set Analysis Help required

Can a sample app be posted?

vikasmahajan
Honored Contributor III

Re: U R G E N T - Set Analysis Help required

No  Application can be share.

Re: U R G E N T - Set Analysis Help required

Hi

Try like this

(SUM({1<FiscalYear={$(=max(FiscalYear)-1)}>}[Sales Invoice Qty])

-

SUM({1<FiscalYear={$(=max(FiscalYear)-1)}>}[Sales Return Qty])

)/1000

vikasmahajan
Honored Contributor III

Re: U R G E N T - Set Analysis Help required

I think this will not work  Set analysis will ignore user selection dimension if we use 1 identifier.

sum({1} Sales) =>  Returns total sales within the application, disregarding selections but not

the dimension.

Thanks

Vikas

Re: U R G E N T - Set Analysis Help required

Hi,

Below expression will work.

(SUM({$<FiscalYear={$(=Max(FiscalYear)-1)}>} [Sales Invoice Qty])

-

SUM({$<FiscalYear={$(=Max(FiscalYear)-1)}>} [Sales Return Qty])

)/1000

Make sure that you don't have any data issues.

Also shouldn't get divide by zero error means SUM({$<FiscalYear={$(=Max(FiscalYear)-1)}>} [Sales Return Qty]) expression should result zero.

MVP
MVP

Re: U R G E N T - Set Analysis Help required

You can share your application without worring about data, look at this and this too.

vikasmahajan
Honored Contributor III

Re: U R G E N T - Set Analysis Help required

Thx a lot for your quick answer.

I tried and unfortunately it doesn't work.

Community Browser