Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a problem when I use the class function, please see below :
I have data like :
And I use this dimension to show the sum(VALUE) in a chart :
But it shows like :
I wonder why it didn't show the 2 <= < 10000,
I just want to show like :
I don't know why it shows 0 <=,
could you please help me to do that? Or if you have any other method, please tell me.
The order need to like above and I also try to use like :
if(F1<-100,class(F1,1,''),if(F1<0,class(F1,0.05,''),if(F1<2,class(F1,0.01,''),' 2<=')))
But I think it is a little ugly and it must have better way to do that.
Thanks and any questions please tell me, you can use the attached.
May be this as your calculated dimension:
=If(F1 < -100, | Class(F1,1,''), | |
If(F1 < 0, | Class(F1,0.05,''), | |
If(F1 < 2, | Class(F1,0.01,''), |
If(F1 < 10000 and F1 >= 2, Dual('2 <= < 10000', 5001), ' 2<='))))
May be this as your calculated dimension:
=If(F1 < -100, | Class(F1,1,''), | |
If(F1 < 0, | Class(F1,0.05,''), | |
If(F1 < 2, | Class(F1,0.01,''), |
If(F1 < 10000 and F1 >= 2, Dual('2 <= < 10000', 5001), ' 2<='))))
Hi Sunny,
Thanks for your reply.
This is my first time to use DUAL function, if possible could you please tell me when I can use it?
And I have another question Dual('2 <= < 10000', 5001) in your suggestion : can I change the 5001 to any number? do some other columns will affect the column's value when I use 5001, or the value will affect other columns value when i use 5001?
I am just afraid of that.
Thanks again.
I put the number 5001 as an average of 2 and 10000, but I think the idea is to put a number which would making the sorting correct. This number can be any number bigger than 2 in your case.
Dual function is a function which is used when you want to assign a numeric value to a text. In this case '2 <= < 10000' is text, but it also was assigned a numeric value of 5001. Again did it so that it can be sorted properly.
HTH
Got it! Thank you so much for your help!
But do you know why the class shows wrong if I use like that?