Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
300sss300
Creator
Creator

Months comparison in % as Expression

Hi everyone!

I want to show a line chart with % variation for each month and quarter. (Both Quantity and Value)

Script is as below

LOAD Date,

  Year (Date) as Year,

     Month (Date) as Month,

     Day (Date) as Day,

     MonthName (Date) as YearMonth,

     Org,

     Qty,

     Value

...............................

Also please find attached the Data file.

Best Regards

sunindiayujiyamane

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

Expression: =(Sum(Qty)-Above(Sum(Qty)))/Above(Sum(Qty))

Capture.PNG

View solution in original post

13 Replies
sunny_talwar

So are you looking for 4 lines on a same chart?

effinty2112
Master
Master

Hi Khyam,

Add a Qtr field to you load script:

Year (Date) & 'Q' & Ceil(Month (Date)/3) as Qtr,

For monthly variance of Qty create a line chart with dimension Month and these two expressions:

sum(Qty)

(sum(Qty)-RangeSum(Above(Qty,1,1)))/RangeSum(Above(Qty,1,1))

Fro the first expression de-select the 'Line' checkbox in the 'Display Options' part of the Expressions tab.

If you want to show the var in Value in the same chart add

sum(Value)

(sum(Value)-RangeSum(Above(Value,1,1)))/RangeSum(Above(Value,1,1))

As before de-select the 'Line' checkbox for the sum(Value) expression.

For the quarterly variance change the dimension to Qtr.

Hope this helps.

300sss300
Creator
Creator
Author

No separate for Months and Quarter

but I am concerned mainly with Months Chart should show variation in % from Jan to Dec (11 Data points)

Best Regards,

300sss300
Creator
Creator
Author

Hi Andrew,

Thanks for the reply.

Quarter was added successfully as field.

But the other part related to variation is not working.

Best Regards,

effinty2112
Master
Master

Hi Khyam,

Have a look at this qvw. It gives this chart for month comparison of qty. Nothing for Jan as no previous month data.

Month comparision on Qty.jpg

Dimension: Month

Expressions:     sum(Qty)

                         (sum(Qty)-RangeSum(Above(Qty,1,1)))/RangeSum(Above(Qty,1,1))

the first expression is not shown by de-selecting the 'Line' display option

sunny_talwar

May be like this:

Expression: =(Sum(Qty)-Above(Sum(Qty)))/Above(Sum(Qty))

Capture.PNG

300sss300
Creator
Creator
Author

I have used this as second expression and unselected line option for Sum(Value) expression.

(sum(Value)-RangeSum(Above(Value,1,1)))/RangeSum(Above(Value,1,1))

its not working

300sss300
Creator
Creator
Author

Thanks!

It is working.

But image is like this. what is missing???

1.png

sunny_talwar

How you want to see the image as?