Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mixing static and summed data

Hi All

I am brand new to QlikView, and have just seen the getting started webinar.  I have a general question,  I have two tables.  One holds target counts for some specific criteria.  The other tables holds records for the item which is being counted.  Both tables have some filtering criteria in common e.g region.  The question is, can I create a vertical chart where each region displays two bars, one for the target count in the first table, and one for the actual count based on the sum of records in the second table?

Thx,

Hamayoun

1 Solution

Accepted Solutions
angelaecheverri
Creator
Creator

rirst thing you need to do is load both tables(Goals and Opportunities)

then both tables must be linked by a Key.

Like this

Goals:

Load

Autonumber(Year&'-'&Type&'-'&Region) as Key.Main,

Year          as Year_Goals,

Type          as Type_Goals,

Region        as Region_Goals,

Target     as Target_Goals

From

xxxx

Opportunities:

Load

Autonumber(Year&'-'&Type&'-'&Region) as Key.Main,

OppID,

Year,

Type,

Region,

Status

From

xxxxx

then In the chart objet

Dimension         Year

Expresion 1        sum(Target)    ---> it will sum target

Expresion 2          count({<Status = {'Won'}>} Status)  --> it will count registers which status is won.


View solution in original post

6 Replies
swuehl
MVP
MVP

Probably yes, but it would be helpful if you could describe your data model (the two tables) a bit more detailed.

You'll need to link your two tables by a key field (as you probably know, a field with common name in both tables).

Please note that linking the tables by more than two fields with common names introduces a syn key table, and is probably not working as intended, that's why it's important to know more about your data.

Not applicable
Author

Ok, let me clarify swuehl.  Table 1, lets call it 'Goals', has the following fields:

Year

Type

Region

Target Count

It stores the target counts of successfully completed Opportunities per year, per type, per region.  Table 2, the 'Opportunities' table, has the following fields:

Year

Type

Region

Status - indicates if the opportunity has successfully completed

So my requirement is that on one chart, I can display side-by-side two vertical bars per type, one bar being the Target Count from the Goals table, and the other bar being the sum of the corresponding Opportunities where the Status indicates that the Opportunity is successful.

Thx,

Hamayoun

swuehl
MVP
MVP

I would probably either join or concatenate the two tables into one table (I think I would go for a join (or mapping)).

Something like

LOAD

     Year,

     Type,

     Region,

     Target

FROM ...;

LEFT JOIN LOAD

     Year,

     Type,

     Region,

     Status

FROM ...;

This should result in a table with fields Year, Type, Region, Target and Status (maybe I am misunderstanding your setting, maybe you have multiple opportunities and want to sum something you haven't mentioned so far?)

Then you can create a chart and show the Target count:

=sum(Target)

and the target count only for the successful status:

=sum(if(Status='Success',Target))

or

=sum({<Status = {Success}>}Target)

Not applicable
Author

Still not sure if you understand what I need, so let me do this explicitly, sorry I didn't do it like this in the first place.

So here is the data for the Goals table:

YearTypeRegionTarget
2013T1R110
2013T1R211
2013T2R112
2013T2R213

And here is the data for Opportunities table:

OppIDYearTypeRegionStatus
Opp12013T1R1Won
Opp22013T1R2Closed
Opp32013T2R1In Progress
Opp42013T2R2Won
Opp52013T1R1Closed
Opp62013T1R2In Progress
Opp72013T2R1Won
Opp82013T2R2Closed
Opp92013T1R1In Progress
Opp102013T1R2Won
Opp112013T2R1Closed
Opp122013T2R2In Progress
Opp132013T1R1Won
Opp142013T1R2Closed
Opp152013T2R1In Progress
Opp162013T2R2Won
Opp172013T1R1Closed
Opp182013T1R2In Progress
Opp192013T2R1Won
Opp202013T2R2Closed

I want a chart that shows, per type, Target Count vs Sum of Won Opportunities.  For the data above, it would like look this.

chart1.png

So can this be done in QlikView?

Thx,

Hamayoun

angelaecheverri
Creator
Creator

rirst thing you need to do is load both tables(Goals and Opportunities)

then both tables must be linked by a Key.

Like this

Goals:

Load

Autonumber(Year&'-'&Type&'-'&Region) as Key.Main,

Year          as Year_Goals,

Type          as Type_Goals,

Region        as Region_Goals,

Target     as Target_Goals

From

xxxx

Opportunities:

Load

Autonumber(Year&'-'&Type&'-'&Region) as Key.Main,

OppID,

Year,

Type,

Region,

Status

From

xxxxx

then In the chart objet

Dimension         Year

Expresion 1        sum(Target)    ---> it will sum target

Expresion 2          count({<Status = {'Won'}>} Status)  --> it will count registers which status is won.


Not applicable
Author

Thanks Angela!