Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
snehamahaveer
Creator
Creator

Sparkline for a 6 month period

Hi Everyone,

I am trying to work on sparklines in my straight table and I guess it must be my ignorance that I am unable to solve this simple issue.

I have created the table with 2 dimensions - customer and product, then 3 expressions - YTD, YTD previous year, Trend(sparkline).

My issue's are:-

1. I am unable to keep the trend constant - 6 month period

2. I have Financial month loaded as Num(finmonth) and when I use set analysis for sparkline mini chart as =sum({<Finmonth = {'>$(=Max(Finmonth)-6) <=$(=Max(finmonth))'}>}Sales) does not bring back a sparkline unless the max(finmonth) is 7 or greater.

How can I ensure that both issues are resolved.

Your help is much appreciated.

10 Replies
miguelbraga
Partner - Specialist III
Partner - Specialist III

You can make some changes in your qvw like this:

AsOfFinmonth:
load 'Current' as Type,
Finmonth as Finmonth_AsOf,
Finmonth as Finmonth
Resident SalesData;

Concatenate (AsOfFinmonth)
load 'Rolling 6' as Type,
Finmonth as Finmonth_AsOf,
Finmonth + 1 - IterNo() as Finmonth
Resident SalesData
while IterNo() <= 6;

right join load Finmonth Resident SalesData;


And then in the trend you can simply have this set analysis expression:


sum({<Type={'Rolling 6'}>}Sales)


This way, I think and I hope it can solve all your needs