I am using the Class function to generate bucket ranges dynamically and having trouble getting the buckets to generate when inserting variables into the function.
Here is the Class function: =Class(x, class_width, format)
Here is how I have tried to recreate it: =Class($(vBucketRange), $(vBucketBin), ' $ ')
Can x be replaced with a formula or variable?
Any assistance would be greatly appreciated.
1. In my requirement, x should be determined based on the larger value of two different fields . . .
=if(Flag_A=1 and Flag_B=1 and (PriceField1 > max(PriceField2)), PriceField1,
if(Flag_A=1 and Flag_B=1 and (PriceField1 < max(PriceField2)), max(PriceField2))
2. The class width should be the difference between the maximum value of two different fields and the minimum value of the same two different fields, divided by the number of bucket ranges selected by the user. . .
I have created variables for the expressions above. Each variable renders the appropriate values when inserted into chart expressions. However, neither the variables nor the expressions seem to work within the Class function dimension.
Thank you for your response. I cannot provide an example of the app, but I have outlined the type of data I am working with - and an explanation of what I am trying to accomplish - in the table below. Based on the requirement, I am not sure that the Total() function will work. Please let me know if this provides enough additional insight.
PriceField1 (for My product)
PriceField2 (for Comp products)
Max Price of either PriceField1 or PriceField2 (based on price of my product and respective competitive products, in multiple stores).In this example, PriceField1 should be used to replace 'x' in the Class function.
Further, I would like the bucket ranges to be calculated based on the range of the highest price across the 2 price fields and the lowest. In this case, the high price is in PriceField1, and the low price is in PriceField2. Therefore, I want my range to be based on the following: