5 Replies Latest reply: Aug 19, 2018 2:45 AM by nikhil garg

# Issue regarding Gauge chart

Hello All,

I am working on Gauge chart in Qliksense. I have used reference lines in Gauge chart. I am using following expression:

"Sum({<Year = {'\$(vPrevYear)'}, MonthNumber = {'<=\$(=vCurMonth)'}, [Transaction Type] = {'Sales'}>}Amount)"

where "\$(vPrevYear)" = '2017'. But issue i am facing is this is working when i am selecting any year in the filter. But i have make the expression such that it should always work even if Year value not selected in the Year Filter. can anyone help em in this?

vPrevYear =Year(Date(Today(), 'MM/DD/YYYY'))-1

vCurMonth = Num(Month(Today()))

• ###### Re: Issue regarding Gauge chart

how have you defined this variable?

in Script or Variable Overview?

Try,

Sum({<Year = {"\$(=vPrevYear)"}, MonthNumber = {'<=\$(=vCurMonth)'}, [Transaction Type] = {'Sales'}>}Amount)

• ###### Re: Issue regarding Gauge chart

I have used following

vPrevYear =Year(Date(Today(), 'MM/DD/YYYY'))-1

vCurMonth = Num(Month(Today()))

and above formula giving us correct values, so i don't think there is some issue with formula. I would request you if you can make some dummy gauge chart and add reference lines and check if they works without selecting filter value of year

• ###### Re: Issue regarding Gauge chart

In the Gauge chart, i ahve simply placed the value in reference line, but still reference line not visible. Pls.find attached snapshot

• ###### Re: Issue regarding Gauge chart

That's quite strange, because since you make your variable using today(), there is no need to select a year for it to work.

When you don't select any year, there is no value on your gauge, that's it ? May you share a picture of the problem you're facing please ?

Regards,

Marina

• ###### Re: Issue regarding Gauge chart

Hey Marina,

In the Gauge chart, i ahve simply placed the value in reference line, but still reference line not visible. Pls.find attached snapshot