Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i'm trying to construct this table :
[Semaine Analyse],
[Key Client] ,
Week,
[Transaction V0]
[Transaction V1]
using two load inside one loop .
Load
$(v) as [Semaine Analyse],
[Key Client] ,
week([Key Date]) as Week,
sum([Montant payé]) as [Transaction V0]
resident Transactions
where week ([Key Date])>=$(Semaine1) and week ([Key Date])<=$(Semaine2)
group by [Key Client], week([Key Date]) ;
and
Load
$(v) as [Semaine Analyse],
[Key Client] ,
week([Key Date]) as Week,
sum([Montant payé]) as [Transaction V1]
resident Transactions
where week ([Key Date])>=$(Semaine3) and week ([Key Date])<=$(Semaine4)
group by [Key Client], week([Key Date]) ;
the loop :
For v = 1 to 27
Let Semaine1 = week(Today())-($(v)*2);
let Semaine2 = week(Today())-($(v)*2)+$(v)-1;
Let Semaine1 = week(Today())-($(v)*2);
let Semaine2 = week(Today())-($(v)*2)+$(v)-1;
the place of my load
Next v
how to do that plz ?
thx
May be try kind of this
TableA:
Load * Inline
[
Semaine Analyse, Key Client, Week, Transaction V0, Transaction V1
];
For v = 1 to 27
Let Semaine1 = week(Today())-($(v)*2);
let Semaine2 = week(Today())-($(v)*2)+$(v)-1;
Let Semaine1 = week(Today())-($(v)*2);
let Semaine2 = week(Today())-($(v)*2)+$(v)-1;
Concatenate(TableA)
Load
$(v) as [Semaine Analyse],
[Key Client] ,
week([Key Date]) as Week,
sum([Montant payé]) as [Transaction V0]
resident Transactions
where week ([Key Date])>=$(Semaine1) and week ([Key Date])<=$(Semaine2)
group by [Key Client], week([Key Date]) ;
Concatenate(TableA)
Load
$(v) as [Semaine Analyse],
[Key Client] ,
week([Key Date]) as Week,
sum([Montant payé]) as [Transaction V1]
resident Transactions
where week ([Key Date])>=$(Semaine3) and week ([Key Date])<=$(Semaine4)
group by [Key Client], week([Key Date]) ;
Next v
anyone have an idea ?
Your construct looks good. Could you share your sample qvw? What is the exact issue you are facing?
thx for respondig ,
its working but i'm getting two tables .and that's what i don't want .
what y need is one table having this structure :
[Semaine Analyse],
[Key Client] ,
Week,
[Transaction V0]
[Transaction V1]
and using the two loads .
Hi
Combine both the tables by using the key word "Concatenate".
Use Concatenate keyword between the two tables.
it's giving bad results (calculation ) .The script create me 27 tables
Either use concatenate (which will double the number of rows) or use a left join between the tables (but this requires identical keys in the tables)
May be try kind of this
TableA:
Load * Inline
[
Semaine Analyse, Key Client, Week, Transaction V0, Transaction V1
];
For v = 1 to 27
Let Semaine1 = week(Today())-($(v)*2);
let Semaine2 = week(Today())-($(v)*2)+$(v)-1;
Let Semaine1 = week(Today())-($(v)*2);
let Semaine2 = week(Today())-($(v)*2)+$(v)-1;
Concatenate(TableA)
Load
$(v) as [Semaine Analyse],
[Key Client] ,
week([Key Date]) as Week,
sum([Montant payé]) as [Transaction V0]
resident Transactions
where week ([Key Date])>=$(Semaine1) and week ([Key Date])<=$(Semaine2)
group by [Key Client], week([Key Date]) ;
Concatenate(TableA)
Load
$(v) as [Semaine Analyse],
[Key Client] ,
week([Key Date]) as Week,
sum([Montant payé]) as [Transaction V1]
resident Transactions
where week ([Key Date])>=$(Semaine3) and week ([Key Date])<=$(Semaine4)
group by [Key Client], week([Key Date]) ;
Next v
the solution is to begane by create an empty table .
thx all