Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
maybe is trivial issue but i'm wondering to create calculated dimension in my script.
I'm able to create calculated dimension with simple formulas like in my attachment but i don't know how to create dimension a little bit complex.
As you can see here i created the "key" dimension and now i can calculate the value of sales for the dimension...but if i want to create a dimension that is "sales per key" how should i do??
Clear enough?
Thank u all.
sunindia what do u think about it?
Messaggio modificato da Filiberto Cacciari Hi guys, i've attached also my qvw cause i've a new little problem. Now I display the sum of KeySales but I want that when the value of sales is the same it will be sum once. Sample_Int: LOAD * INLINE [ Dim1, Dim2, Dim3, Sales A, B, C, 10 A, B, C, 10 A, B, C, 5 A, B, C, 5 C, B, A, 15 C, B, A, 15 C, B, A, 5 ]; Sum(ABC) = 15 and not 30 Sum(CBA) = 20 and not 35
Settu's script is working:
How about this:
Sample_Int: |
LOAD * INLINE [ | |
Dim1, Dim2, Dim3, Sales | |
A, B, C, 10 | |
A, B, C, 10 | |
A, B, C, 5 | |
A, B, C, 5 | |
C, B, A, 15 | |
C, B, A, 15 | |
C, B, A, 5 | |
]; | |
Sample: | |
load | |
Dim1, | |
Dim2, | |
Dim3, | |
Dim1&Dim2&Dim3 as Key, | |
Sales | |
Resident Sample_Int; |
KeySales: | |
Load Key, | |
Sum(distinct Sales) AS KeySales | |
Resident Sample | |
Group by Key; |
Alternatively, this should also work:
Sample_Int:
Load *,Dim1&Dim2&Dim3 as Key;
LOAD * INLINE [
Dim1, Dim2, Dim3, Sales
A, B, C, 10
A, B, C, 10
A, B, C, 5
A, B, C, 5
C, B, A, 15
C, B, A, 15
C, B, A, 5
];
KeySales:
Load Key,
Sum(DISTINCT Sales) AS KeySales
Resident Sample_Int
Group by Key;
Yep. Like what I've posted moment ago. thx all of you
Ya, I think it should work (like I mentioned below)