Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everybody
I have this data-set where I have some dimensions. Within one of those dimensions I want add a calculated field, based on two fields in that dimension.
Please se attached example. Trying to do it with Left Join and Resident in the script function.
Is it possible in any way?
Regards
Stefan
try this
Dimension:
=ValueList('Pages','Revenue','Rev per page')
Expression:
=Pick(match(ValueList('Pages','Revenue','Rev per page'),'Pages','Revenue','Rev per page'),
sum({<Type={'Pages'}>}Amount),
sum({<Type={'Revenue'}>}Amount),
sum({<Type={'Pages'}>}Amount)/
sum({<Type={'Revenue'}>}Amount))
So basically I want to add another field under the dimension "Type", which is called "Rev per page".
Create synthetics dimension using valuelist function or create inline table
Data:
LOAD Media,
Type,
Month,
Amount
FROM
C:/example.xlsx
(ooxml, embedded labels, Table is Ark1);
Type:
load * inline [
TypeNew
Pages
Revenue
Rev per page
];
Create chart
Dimension:
TypeNew
Expression:
Pick(match(TypeNew,'Pages','Revenue','Rev per page'),
sum({<Type={'Pages'}>}Amount),
sum({<Type={'Revenue'}>}Amount),
sum({<Type={'Pages'}>}Amount)/
sum({<Type={'Revenue'}>}Amount) )
Hi Kushal
Either I'm doing something wrong or it's not working.
When I'm Copying above script into my qvd file, it doesn't give me the right answer.
It just says "Error in calculation" and just Sum alle the numbers.
Regards
Stefan
I have been trying to figure what I'm doing wrong, but I can't seem figure it out.
Anyone else got some ideas how to solve this?
Regards
Stefan
Can you please share sample app.
Hej Mahesh
Please see attached
Regards
Stefan
can you please share the sample source file.
try this
Dimension:
=ValueList('Pages','Revenue','Rev per page')
Expression:
=Pick(match(ValueList('Pages','Revenue','Rev per page'),'Pages','Revenue','Rev per page'),
sum({<Type={'Pages'}>}Amount),
sum({<Type={'Revenue'}>}Amount),
sum({<Type={'Pages'}>}Amount)/
sum({<Type={'Revenue'}>}Amount))
Yes of course