Qlik Community

Qlik Brasil

Group community for Brazil users. discussion only in Portuguese.

Highlighted
Not applicable

How to add planed YTD on a chart?

Hi,

I have a chart as below where I want to show PLAN, Actual, YTD along with 2014 - 2015 (YTD). So I have used below query

Sum({<Year = {'2014', '2015' }>}[Actual SPCD hit rate_CUTTING]/12)

1. is the query is right?

2. If that so, I don't want to show 0% I just want to show the line only where there is a value how do I do that?

Eg: Line only on top of Jan, Feb and Mar

Chart.png

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: How to add planed YTD on a chart?

correct answers

1. RangeAvg( above( avg([Actual GRN Hit Rate_STORES]),0,12) )

2. =avg({<Year={'$(vPriorYear)'} ,Month=,Day=,Date={'<=$(vYear)'}, MonthYear=>}[Actual GRN Hit Rate_STORES])

5 Replies
MVP
MVP

Re: How to add planed YTD on a chart?

Not clear from your question.... can you elaborate little more with sample file or apps?

Not applicable

Re: How to add planed YTD on a chart?

1. If I want to know YTD following query "avg([Actual SPCD hit rate_CUTTING]/12)" is right?

2. If I want to know YTD of 2015 following query "Sum({<Year = {'2014', '2015' }>}[Actual SPCD hit rate_CUTTING]/12)" is right?

3. guess you can see the pink line one the char there I don't won't the pink line to 0% I want only if there is an value, how do I do that? 

MVP
MVP

Re: How to add planed YTD on a chart?

Still not clear.. Can you provide sample data please ?

egnaldo_sousa
Contributor II

Re: How to add planed YTD on a chart?

try:

If(Sum({<Year = {'2014', '2015' }>}[Actual SPCD hit rate_CUTTING]/12) > 0

     ,Sum({<Year = {'2014', '2015' }>}[Actual SPCD hit rate_CUTTING]/12)

     , Nul()

)

Not applicable

Re: How to add planed YTD on a chart?

correct answers

1. RangeAvg( above( avg([Actual GRN Hit Rate_STORES]),0,12) )

2. =avg({<Year={'$(vPriorYear)'} ,Month=,Day=,Date={'<=$(vYear)'}, MonthYear=>}[Actual GRN Hit Rate_STORES])