Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

lakwinder
Contributor III

I want to use an expression as a dimension for a line chart

Hi Guys,

I want to use an expression as a dimension for a line chart, I got variables set as Current month to Previous 12 months, how do I use all of them so I wouldn't have to change them every month, that they will be dramatic.

Cheers

23 Replies

Re: I want to use an expression as a dimension for a line chart

I don't understand what you're trying to do. Can you post a small qlikview document that explains the problem?


talk is cheap, supply exceeds demand
lakwinder
Contributor III

Re: I want to use an expression as a dimension for a line chart

I want to use these variables as an expression as the X axis on a line chart instead of a dimension.

LET vMonthPrevious1 = Date(Monthstart(AddMonths(Today(),-1)), 'YYYYMM');

LET vMonthPrevious2 = Date(Monthstart(AddMonths(Today(),-2)), 'YYYYMM');

LET vMonthPrevious3 = Date(Monthstart(AddMonths(Today(),-3)), 'YYYYMM');

LET vMonthPrevious4 = Date(Monthstart(AddMonths(Today(),-4)), 'YYYYMM');

LET vMonthPrevious5 = Date(Monthstart(AddMonths(Today(),-5)), 'YYYYMM');

LET vMonthPrevious6 = Date(Monthstart(AddMonths(Today(),-6)), 'YYYYMM');

LET vMonthPrevious7 = Date(Monthstart(AddMonths(Today(),-7)), 'YYYYMM');

LET vMonthPrevious8 = Date(Monthstart(AddMonths(Today(),-8)), 'YYYYMM');

LET vMonthPrevious9 = Date(Monthstart(AddMonths(Today(),-9)), 'YYYYMM');

LET vMonthPrevious10 = Date(Monthstart(AddMonths(Today(),-10)), 'YYYYMM');

LET vMonthPrevious11 = Date(Monthstart(AddMonths(Today(),-11)), 'YYYYMM');

LET vMonthPrevious12 = Date(Monthstart(AddMonths(Today(),-12)), 'YYYYMM');

lakwinder
Contributor III

Re: I want to use an expression as a dimension for a line chart

Or how do I create a variable to show the last 12 months from last month, so Jan 2015 to Jan 2014.

Re: I want to use an expression as a dimension for a line chart

Maybe this:

LET vLast12Months = '>=$(=' & 'MonthStart(Today(),-12))<=$(=' & 'MonthStart(Today(),-1)))';


talk is cheap, supply exceeds demand
lakwinder
Contributor III

Re: I want to use an expression as a dimension for a line chart

I'll give it a go.

Also, can you use expressions/variables for the labels in the tables like qlikview?

lakwinder
Contributor III

Re: I want to use an expression as a dimension for a line chart

It didn't work, it's only showing one value/point rather than 12

Re: I want to use an expression as a dimension for a line chart

Oh, you're using the variable in an expression in a chart without a dimension? Yes, then the expression can only return one value. Either add twelve expressions, one for each month, or add a month dimension to your chart.


talk is cheap, supply exceeds demand
lakwinder
Contributor III

Re: I want to use an expression as a dimension for a line chart

Will a chart work without a dimension in QS?

Re: I want to use an expression as a dimension for a line chart

a gauge chart


talk is cheap, supply exceeds demand
Community Browser