2

I am new to Qlikview and after several failed attempts I have to ask for some guidance regarding charts in Qlikview. I want to create Line chart which will have:

One dimension – time period of one month broke down by days in it

One expression – Number of created tasks per day

Second expression – Number of closed tasks per day

Third expression – Number of open tasks per day

This is very basic example and I couldn’t find solution for this, and to be honest I think I don’t understand how I should setup my time period dimension and expression. Each time when I try to introduce more then one expression things go south. Maybe its because I have multiple dates or my dimension is wrong.

Here is my simple data:

http://pastebin.com/Lv0CFQPm

I have been reading about helper tables like Master Callendar or “Date Island” but I couldn’t grasp it. I have tried to follow guide from here: https://community.qlik.com/docs/DOC-8642 but that only worked for one date (for me at least).

How should I setup dimension and expression on my chart, so I can count the ID field if Created Date matches one from dimension and Status is appropriate?

I have personal edition so I am unable to open qwv files from other authors.

Thank you in advance, kind regards!

jabree
  • 77
  • 3
  • 8

1 Answers1

5

My solution to this would be to change from a single line per Call with associated dates to a concatenated list of Call Events with a single date each. i.e. each Call will have a creation event and a resolution event. This is how I achieve that. (I turned your data into a spreadsheet but the concept is the same for any data source.)

Calls:
LOAD Type, 
     Id, 
     Priority, 
     'New' as Status,
     date(floor(Created)) as [Date],
     time(Created) as [Time]
FROM
[Calls.xlsx]
(ooxml, embedded labels, table is Sheet1) where Created>0;

LOAD Type, 
     Id, 
     Priority, 
     Status,  
     date(floor(Resolved)) as [Date],
     time(Resolved) as [Time]
FROM
[Calls.xlsx]
(ooxml, embedded labels, table is Sheet1) where Resolved>0;

Key concepts here are allowing QlikView's auto-conatenate to do it's job by making the field-names of both load statements exactly the same, including capitalisation. The second is splitting the timestamp into a Date and a time. This allows you to have a dimension of Date only and group the events for the day. (In big data sets the resource saving is also significant.) The third is creating the dummy 'New' status for each event on the day of it's creation date.

With just this data and these expressions

Created = count(if(Status='New',Id))
Resolved = count(if(Status='Resolved',Id))

and then

Created-Resolved

all with full accumulation ticked for Open (to give you a running total rather than a daily total which might go negative and look odd) you could draw this graph.

Calls Opened, Closed and Open Total

For extra completeness you could add this to the code section to fill up your dates and create the Master Calendar you spoke of. There are many other ways of achieving this

MINMAX:
load floor(num(min([Date]))) as MINTRANS,
floor(num(max([Date]))) as MAXTRANS
Resident Calls;

let zDateMin=FieldValue('MINTRANS',1);
let zDateMax=FieldValue('MAXTRANS',1);

//complete calendar
Dates:
LOAD
    Date($(zDateMin) + IterNo() - 1, '$(DateFormat)') as [Date]
AUTOGENERATE 1
WHILE $(zDateMin)+IterNo()-1<= $(zDateMax);

Then you could draw this chart. Don't forget to turn Suppress Zero Values on the Presentation tab off. Complete Calendar version

But my suggestion would be to use a combo rather than line chart so that the calls per day are shown as discrete buckets (Bars) but the running total of Open calls is a line

Combo Chart

The Budac
  • 1,571
  • 1
  • 8
  • 10
  • Hey Budac, Thank you very for such detailed response. So, if im getting this right, solution for these kind of chart requirement is to always aim for one date per table because i can only have one time dimension in the first place. In example data i have provided we had one table and two dates, but solution is to create "two" tables and join them together(conatenate). Ill have to read upon this feature a bit to fully understand what just happened there. Ill let you know if i manage to do this later today. Kind regards. – jabree Jun 11 '15 at 09:56
  • I prefer to think of it as one list of all the events rather than 2 tables. But essentially yes we need a common date to use as a dimension – The Budac Jun 11 '15 at 10:22
  • Budac thank you so much for this, i managed to create this chart in few minutes. I saw now what you meant by "events" table. Final table was extra rows and some tasks are duplicated but exactly how i need them to do easy count. Only problem is accumulation of Open count in Pivot, I didnt thought about that but im guessing that's totally different problem/question :) – jabree Jun 12 '15 at 19:18