Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi. So I have a data with attributes, for example
Attribute | Value |
A | 4 |
B | 5 |
C | 6 |
D | 7 |
E | 8 |
F | 9 |
I need to show a line chart with the values for each of these attribute and then A+B as G as well.
So basically in line chart I should be having all the attributes along with G = 9.
I can't do this in backend. Is there anyway to do this in expression in line chart.
Hi,
You can achieve this in backend statement :
TAB1:
load *
INLINE [
Attribute,Value
A,4
B,5
C,6
D,7
E,8
F,9]
;
TAB2:
load
'G' as Attribute,
sum(Value) as Value
resident TAB1
where Attribute ='A' or Attribute= 'B';
Hello,
You can create a synthetic dimension with Valuelist based on existing data and adding non-existing data explicitly as below:
=ValueList($(=concat(chr(39) & Attribute & chr(39),',')),'G')
In the expression, you have to define formula for each field value as below:
pick(match(ValueList($(=concat(chr(39) & Attribute & chr(39),',')),'G'),$(=concat(chr(39) & Attribute & chr(39),',')),'G'),
$(=Concat(aggr('Sum({<Attribute={"'&Attribute&'"}>} Value)',Attribute),',')),
Sum({<Attribute={"A","B"}>} Value)
)
Downside of ValueList is that you can not select values and filter on this synthetic field as this field does not exist in the data model.
I hope this solves your problem.