Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

cross dimention

Hi!

I have table:

CountrymonthSum (Sale)
England20120824971
England20120925826
England20121024560
England20121115207
Japan2012086481
Japan2012095705
Japan2012106106
Japan2012112699

from this table i want make like this table:

Countryperiod 3 monthSum (Sale)
England201210 & 201209 & 20120875357
England201211 & 201210 & 20120965593
Japan201210 & 201209 & 20120818292
Japan201211 & 201210 & 20120914510

Is posseble create dimention like this way?   Problem that a have '201209' in bouth periods.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Yes, it's possible. See attached example


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Yes, it's possible. See attached example


talk is cheap, supply exceeds demand
Not applicable
Author

Hi, Gysbert!

Thank you for your help.

I am trying to understand your example step by step.

1. i have original data  such as:

CountrySalepmonth
England25 826201209
England24 560201210
England15 207201211

i geting them from sql store procedure like

SQL SELECT *

FROM "LD_StoreProc".dbo.testIP;

2.  i have to adding for every p month in my data new field wich aggrigate 3 mont period?

CountrySalepmonthmonth
England28 343201207201209
England24 971201208201209
England25 826201209201209
England24 971201208201210
England25 826201209201210
England24 560201210201210

and i have to do it before load into QV in  my "LD_StoreProc"?

Gysbert_Wassenaar

Try this to create T1:

T1:

load Country,month,SumSale,

Monthstart(date#(month&'01','YYYYMMDD')) as mstart;

SQL SELECT * FROM "LD_StoreProc".dbo.testIP;

Make sure you use the correct field names. Qlikview is case sensitive, so Country is not the same field as country.

The rest can stay the same. It first creates three pmonth records for every month in the original data. This is where the while clause and the iterno() function are used. The result of that is then joined on the original data. The rest is cleaning up and sorting the resulting table.


talk is cheap, supply exceeds demand
Not applicable
Author

thank you!  i think i got it