Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Set analysis remove results

Dear all,

I currently have a set analysis syntax which is working and also giving me a list of all results. What I need now, is to remove a small selection from this list.

My current syntax is the following:

sum( { $<Month={"=max(Month)"}, Year={"=max(Year)"} > } MachinePurchaseCost)

+

sum({$<InvoiceMonthYear={"$(=$(vMonthYear))"},MonthYearNum ={">= $(=Max(MonthYearNum))"},Month=,Year=>}MachinePurchaseCost)

Now I want to remove some results from the above result. With the following syntax I'm getting the results that I don't want to see.

sum({$<Month={"=max(Month)"},Year={"=max(Year)"},DirectShipFK={"1"},InvoiceMonthYearNum={"<$(=Max(MonthYearNum))"}>}MachinePurchaseCost)

How can I make the syntax so that it will remove these results?

Anyone have an idea how I can achieve this?

Thanks in advance.

1 Solution

Accepted Solutions

Re: Set analysis remove results

Perhaps this:

sum({ $<Month={"=max(Month)"}, Year={"=max(Year)"}>

         + <InvoiceMonthYear={"$(=$(vMonthYear))"},MonthYearNum ={">= $(=Max(MonthYearNum))"},Month=,Year=>

         - <Month={"=max(Month)"},Year={"=max(Year)"},DirectShipFK={"1"},InvoiceMonthYearNum={"<$(=Max(MonthYearNum))"}>

    } MachinePurchaseCost)


talk is cheap, supply exceeds demand
4 Replies

Re: Set analysis remove results

Perhaps this:

sum({ $<Month={"=max(Month)"}, Year={"=max(Year)"}>

         + <InvoiceMonthYear={"$(=$(vMonthYear))"},MonthYearNum ={">= $(=Max(MonthYearNum))"},Month=,Year=>

         - <Month={"=max(Month)"},Year={"=max(Year)"},DirectShipFK={"1"},InvoiceMonthYearNum={"<$(=Max(MonthYearNum))"}>

    } MachinePurchaseCost)


talk is cheap, supply exceeds demand
MVP
MVP

Re: Set analysis remove results

Hi,

Try like this

=(sum( { $<Month={"=max(Month)"}, Year={"=max(Year)"} > } MachinePurchaseCost)

+

sum({$<InvoiceMonthYear={"$(=$(vMonthYear))"},MonthYearNum ={">= $(=Max(MonthYearNum))"},Month=,Year=>}MachinePurchaseCost) ) -

sum({$<Month={"=max(Month)"},Year={"=max(Year)"},DirectShipFK={"1"},InvoiceMonthYearNum={"<$(=Max(MonthYearNum))"}>}MachinePurchaseCost)

         

Not applicable

Re: Set analysis remove results

Thanks, This one did the trick. My final result looks like

sum({ $<Month={"=max(Month)"}, Year={"=max(Year)"}>


         + <InvoiceMonthYear={"$(=$(vMonthYear))"},MonthYearNum ={">= $(=Max(MonthYearNum))"},Month=,Year=>


         - <Month={"=max(Month)"},Year={"=max(Year)"},DirectShipFK={"1"},InvoiceMonthYearNum={"<$(=Max(MonthYearNum))"}>

   

         - <Month={"=max(Month)"},Year={"=max(Year)"},DirectShipCE={"1"},InvoiceMonthYearNum={"<$(=Max(MonthYearNum))"}> 
} MachinePurchaseCost)

Highlighted
Not applicable

Re: Set analysis remove results

This one I tried myself already but it didn't gave me the correct result. For some reason it always showed a couple of records which should be excluded.

Community Browser