Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Mch201
Contributor III
Contributor III

How to display trends with big changes

Hi, I have a set of data with customer, product purchased on weekly basis and quantity.

in the data, there are about 1000 customers. I only want to display the customers where there's a 30% drop or 30% jump in the quantity of orders for the most recent week. view the example below

 

customerproductquantity 
Johnse226
Johnse239
Johnse223
Johnse227
Johnse226
Johnse226
Johnse2287

 

As you can see john has been very consistent with his purchases except his latest purchase was huge compared to his previous purchase. this is the type of customer i want to view in form of a line chart displaying the trend. 

 

Most customers are always consistent with heir order quantity, but in case there is a 30% drop or a jump, we want to display that on a line chart showing the trend

Labels (2)
7 Replies
PriyankaShivhare
Creator II
Creator II

please go thru the below link
http://dataonthe.rocks/outliers-in-qlik-sense/

hope this helps!

Thanks,
Priyanka
PradeepK
Creator II
Creator II

whenever you want to show some exception .. try to find which property is best fit - Size, Shape ,Color

In Case of Line Chart data point Size and shape is constant for all.. So only option is yo use Color property.

Look into Color() and Colormix1() function in qlik - Docs 

Line.png

 

For Reference Only :

Color by expression

 

ColorMix1(
	(sum(quantity) - $(=Min(Aggr(sum(quantity), pdate, customer)))) 
    / $(=Max(Aggr(sum(quantity), pdate, customer)))
    ,color(FieldIndex('customer',customer)), green()
)

 

 

 

I hope this answers your question.

 

PradeepK
Creator II
Creator II

Whenever you want to highlight exception data.. ask yourself what is the best property : Size, Shape , Color

In case of line chart Size and Shape is constant for all data points.. So you can use Color property 

look into Color properties - doc 

Line.png

 

 

Code for Reference Only :

ColorMix1(
	(sum(quantity) - $(=Min(Aggr(sum(quantity), pdate, customer)))) 
    / $(=Max(Aggr(sum(quantity), pdate, customer)))
    ,color(FieldIndex('customer',customer)), green()
)

 

I hope this answers your question.

Mch201
Contributor III
Contributor III
Author

This is helpful and good to know. But what if I only want to display top 5 customers with the biggest jump or drop?? how would I do something like that?

Ksrinivasan
Specialist
Specialist

hi,

SOD:
Load
AutoNumber(RowNo()) as Order_Sequence,
customer,
product,
"quantity"
FROM [lib://REPORT EXTRACTION SSSS1.xlsx]
(ooxml, embedded labels, table is [custome sales drop]);

TTT:
Load *,
if((((Previous("quantity")/"quantity")* 100)-100) > 30 , 'High_Jump','') as High_PER,
if((((Previous("quantity")/"quantity")* 100)-100) < -30 , 'Low_Jump','') as Low_PER,
((Previous("quantity")/"quantity")* 100)-100 as Percentage
Resident SOD
Order by customer;

 

Ksrinivasan_0-1611847030781.png

further drill down chart

Ksrinivasan_1-1611847146960.png

in chart you can use limitation with 10 values with ascending or descending values.

i hope it will help to you.

ksrinivasan

 

 

Mch201
Contributor III
Contributor III
Author

Thanks for the answer. where exactly would I put this script

Ksrinivasan
Specialist
Specialist

hi,

in load script,

Load *,

((Previous("quantity")/"quantity")* 100)-100 as Percentage
Resident SOD
Order by customer;

 

in chart you can use

DIM: Customer

Measure: Max(Percentage)

Chart range in  y-axis setting Max and Min range. 

for >30%order min 30, 

for <30%order min -30, 

ksrinivasan