Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

YOY Comparison

Hello -

I am attempting to do a YOY comparison in a chart; and with the research I have done I have not seen my exact situation.

I have a couple of variables; Inventory Type, Count of CCPInqKey, and Receivedhumanadata.

Ofcourse the Date portion is where I will be getting the Month and Year; the CCPInqKey is the count for the month, and the Inventory Type is the variable of what I want to count the YOY differences.

I've attempted to put together the below script from the other discussions I have found but with the below I get the error "Error in set modifier expression".

Im not sure if I am way off base with this; but have attached a sample of what I currently have.

sum({<Year(RECEIVEDHUMANADATE)={'2015'}>}count(INVENTORYTYPE)

I appreciate any assistance. Thanks!

Tags (1)
1 Solution

Accepted Solutions

Re: YOY Comparison

You cannot use functions on the left hand side of a set modifier.

Sum({<Year(RECEIVEDHUMANADATE)={'2015'}>}count(INVENTORYTYPE)

Secondly, you cannot have one aggregation over another without using Aggr() function.

Sum({<Year(RECEIVEDHUMANADATE)={'2015'}>}count(INVENTORYTYPE)

In your case, try this: Instead you can create Year() in the script and use that in your set expression

LOAD INVENTORYTYPE,

          RECEIVEDHUMANADATE,

          Year(RECEIVEDHUMANADATE) as Year

FROM ....

and then may be this:

Count({<Year = {2015}>}INVENTORYTYPE)

View solution in original post

2 Replies

Re: YOY Comparison

You cannot use functions on the left hand side of a set modifier.

Sum({<Year(RECEIVEDHUMANADATE)={'2015'}>}count(INVENTORYTYPE)

Secondly, you cannot have one aggregation over another without using Aggr() function.

Sum({<Year(RECEIVEDHUMANADATE)={'2015'}>}count(INVENTORYTYPE)

In your case, try this: Instead you can create Year() in the script and use that in your set expression

LOAD INVENTORYTYPE,

          RECEIVEDHUMANADATE,

          Year(RECEIVEDHUMANADATE) as Year

FROM ....

and then may be this:

Count({<Year = {2015}>}INVENTORYTYPE)

View solution in original post

vinieme12
Esteemed Contributor II

Re: YOY Comparison

You cannot use functions on the left side of the comparison , you will need to create the field in your script during load.

Year(RECEIVEDHUMANADATE) as received_year


Then use this feild in your set expression

count({<received_year={2015}>}INVENTORYTYPE)