Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
laujerry
Creator
Creator

Date Island Problem

Sorry that this question may be a bit long to read...

I have three tables: SalesHeader, SalesItem and Target

I am going to make an analysis between target & actual sales

SalesHeader

doc datedoc #
1/1/20121000101
15/1/20121000102
20/1/20121000103
1/2/20121000104
15/2/20121000105
1/3/20121000106
1/4/20121000107
15/4/20121000108
1/5/20121000109
15/5/20121000110
6/6/20121000111

SalesItem

doc #item #oty qty
100010115
100010123
100010214
100010315
100010327
100010339
100010411
100010516
100010611
100010624
100010711
100010815
100010919
100011013
100011111

Target

YearMonthTarget
201215
201226
201235
201247
201258
2012610

Additionally I loaded

- Year([doc date]) & '-' & Month([doc date]) as [doc yr-mth] // in SalesHeader

- [target year] & '-' & [target month] as [target yr-mth] // in Target

So now I will have SalesHeader and SalesItem naturally joined by QV

and Target as an isolated table

I create a straight table chart using

- [doc yr-mth] // as dimension

- Sum({$<[doc yr-mth]={[target yr-mth}>}target) // as expression1

- Sum([order quantity]) // as expression2

to check my result

I expect the result would be sth like

Yr-MthTargetActual
2012-1533
2012-267
2012-355
2012-476
2012-5812
2012-6101

4164

But it shows actually like

Yr-MthTargetActual
2012-14133
2012-2417
2012-3415
2012-4416
2012-54112
2012-6411

4164

Remark: the actual tables has lot more fields associated

so I am not going to consider simply making a key joining the 2 yr-mth keys

What's wrong with my expression?  Any idea to solve it?  Thanks!

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Rename [target yr-mth] to [doc yr-mth], make sure the fields have the same format and use as expression simply sum(Target). See attached example.


talk is cheap, supply exceeds demand
laujerry
Creator
Creator
Author

thanks for your replay

actually my target table will contain other dimension information that associated with the sales data, like "product type", "salesman"... e.g.:

SalesItem

doc #item #product typeoty qty
1000101115
1000101223
1000102134
1000103135
1000103247
1000103359
1000104111
1000105116
1000106111
1000106234
1000107111
1000108115
1000109119
1000110113
1000111111

Target

YearMonthProduct typeTarget
2012113
2012122
2012214
2012222
2012315
2012417
2012518
20126110

and the actual table size is very large that using synthetic key will make QV overload

{year-mth / product type}

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Download Qlikview Components and look at the LinkTable.qvw document in the Examples folder. You can create the link table you need with the qlikview components library. The example should show you how to do that.


talk is cheap, supply exceeds demand
laujerry
Creator
Creator
Author

so there is no way other than making use of a key-join .. ?

But i still dont understand why in my case the dimension limit does not work

Yr-MthTargetActual
2012-14133
2012-2417
2012-3415
2012-4416
2012-54112
2012-6411

4164