Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Gysbert_Wassenaar

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
Anonymous
Not applicable
Author

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');

Anonymous
Not applicable
Author

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

Gysbert_Wassenaar

Maybe this:

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


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

I'll give it a go.

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

Anonymous
Not applicable
Author

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

Gysbert_Wassenaar

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
Anonymous
Not applicable
Author

Will a chart work without a dimension in QS?

Gysbert_Wassenaar

a gauge chart


talk is cheap, supply exceeds demand