Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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!

1 Solution

Accepted Solutions
sunny_talwar

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
sunny_talwar

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)

vinieme12
Champion III
Champion III

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)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.