Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

YoY chart

Hi all,

I am trying to make a Year over Year chart. What i want to achive is a line chart with Year as dimension, and increase in value since last year as expression.

It looks like this:

TABLE

FACT:

LOAD * INLINE [

FISCAL_YEAR, VALUE

FY17, 2

FY17, 6

FY16, 5

FY16,14

FY15, 10

]

Chart

Dimension: FISCAL_YEAR

Expression: avg(VALUE ) - avg( { $1< FISCAL_YEAR= {'$(=vPrevious_year)'} > } VALUE )

Variable

'FY'&(Right(FISCAL_YEAR,2)-1)

It does not work, and i can't figure out why, the variable alone as expression with the FY as dimensions works fine. Do u have any tips?

Thank you,

PD. i provide some sample data and tables

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Like this?

Capture.JPG

CY = Sum(Value)

Increase = Above(CY)-CY

View solution in original post

7 Replies
Anil_Babu_Samineni
MVP
MVP

My suggestion is this?

FACT:

LOAD *, Right(FISCAL_YEAR,2) as YEAR INLINE [

FISCAL_YEAR, VALUE

FY17, 2

FY17, 6

FY16, 5

FY16,14

FY15, 10

]

Chart

Dimension: FISCAL_YEAR

Expression: avg(VALUE ) - avg( { $1< FISCAL_YEAR= {'$(=vPrevious_year)'} > } VALUE )

Variable

Max(YEAR)-1

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresB
Champion III
Champion III

Like this?

Capture.JPG

CY = Sum(Value)

Increase = Above(CY)-CY

Anonymous
Not applicable
Author

Yes i think is that! I am checking it!

Thank you very much!

Anonymous
Not applicable
Author

Not working, i belive that the reason is that FY17 is a string not a number, that why i was spillting it in my variable.

Thanks anyway!!

Anil_Babu_Samineni
MVP
MVP

I don't have access, As my assumption the degrade should be YEAR only. For sure this should work until unless i am in different root

avg(VALUE ) - avg( { $1<YEAR= {'$(=vPrevious_year)'} > } VALUE )

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresB
Champion III
Champion III

For some reason, I am not able to attach. You can just try as I suggested above.

CY is the first expression label. Or, you can try second expression as = Above(Sum(VALUE)) - Sum(VALUE)

Anonymous
Not applicable
Author

Yes it worked! Sorry i didnt see the expression below the graphic at the beginig.

Thank you for the help!