Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have inline table with variables.I am given below example for reference.only first dimension is getting value in the bar chart and others are not displaying anything but when I select those values in the dimension it is showing values.Only one measure is displaying at a time.Any idea?
A:
Load * inline
[
DimName:
$(currentyear) value,
$(nextyear)value,
$(currentquarter)value
];
I have to use this dimension in bar chart measure expression
if (DimName = $(currentyear)value,sum({$(varuable)value),if(DimName=$(nextyear)value,sum({variable}value)))
You have an object with following expression as a measure?
if (DimName = $(currentyear)value,sum({$(varuable)value),if(DimName=$(nextyear)value,sum({variable}value)))
In order to get a measure value you have to make a selection in DimName?
When using a logic like FieldName = 'Value' in a chart object you meed to make sure that only one FieldName is associated to each row if not then you will not get an true() result. FieldName = 'Value' is interpreted exactly the same way as only(FieldName) = 'Value'
So in your case consider if this is the correct logic for your chart object.
if (only(DimName) = $(currentyear)value,sum({$(varuable)value),if(DimName=$(nextyear)value,sum({variable}value)))
@Vegar : thanks for your reply.
I am using DimName as dimension for the chart and for measure , I am using the below expression
if (DimName = $(currentyear)value,sum({$(varuable)value),if(DimName=$(nextyear)value,sum({variable}value)))
I need to show all values in the dimension in X-axis.Somehow I need to select all values in the field and display all the bars.I have tried with Only condition but it is not working .
Note - Inline table is not associated with existing data model
it could be an issue with your lack of quotation.
Try this:
if (only(DimName) = '$(currentyear)value' ,sum({$(varuable)value),if(DimName= '$(nextyear)value' ,sum({variable}value)))
@Vegar : Yeah I have tried that already but no luck
Could you create and attach an example app that replicates your issue?
@Vegar : I dont have access to share the app.
It is not working when I add the aggr function in the expression ,sample expression which is attached is not working fine.
if (only(DimName) = '$(currentyear)value' ,sum(aggr(sum({$(varuable)value),emp)),if(DimName= '$(nextyear)value' ,sum(aggr(sum({variable}value),emp))