Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am looking to get different dimension values based on same ranking. So, I have created an inline view with Dim and Exp by assigning a value to each dim.
Load * Inline
[
dim, exp
'Style', '1'
'Colour', '2'
'Min Range of Month', '3'
'RRP', '4'
];
And I am looking to bring the corresponding values thru if statement on Straight table
The below expression is not working as expected,
if(exp='1',only(if(Aggr(rank(sum(total <[Style Colour]> [Sales Amount]),4),[Style Colour]) = 1, [Style])),
if(exp='2', only(if(aggr(rank(sum(total <[Style Colour]> [Sales Amount]),4),[Style Colour]) = 1, [Colour])),
if(exp='3', only(if(aggr(rank(sum(total <[Style Colour]> [Sales Amount]),4),[Style Colour]) = 1, [Min Range Month])),
if(aggr(rank(sum(total <[Style Colour]> [Sales Amount]),4),[Style Colour]) = 1, Sum([Sales Amount]))
)
)
)
Can you please check my set analysis and advise why it's not working for other values.
Thanks in advance.
This case you need reverse way against Dimension not expression, something like this
if(exp='1', If(dim='Style', ......) // Please remove Only(), not sure the usage for you.
Thanks @Anil_Babu_Samineni ,
I even tried giving in the following way but still ending up with the same Answer.
if(dim='Style',only(if(aggr(rank(sum(total <[Style Colour]> [Sales Amount]),4),[Style Colour]) = 1, [Style])),
if(dim='Colour', only(if(aggr(rank(sum(total <[Style Colour]> [Sales Amount]),4),[Style Colour]) = 1, [Colour] )),
only(if(aggr(rank(sum(total <[Style Colour]> [Sales Amount]),4),[Style Colour]) = 1, [Min Range Month]))
)
)
And If I remove only () function it is not showing any values in the table. I believe with this only() I am able to match up the possible value as the calculated dimension.
Also I observe, the above expression works only when exp=1 or dim='Style', If I give any other value in the if condition as 1st one in the expression, it is showing all nulls instead of printing it beside Colour in dim.
if(dim='Colour', only(if(aggr(rank(sum(total <[Style Colour]> [Sales Amount]),4),[Style Colour]) = 1, [Colour] )))
Just wondering if there is anything wrong in considering the inline view?
I guess, the condition is matching only to the first attribute. What this is returning as new expression in the same table?
only(if(aggr(rank(sum(total <[Style Colour]> [Sales Amount]),4),[Style Colour]) = 1, [Colour]))
It's bringing up for only first attribute.
please share some data set and application to check in detail.