Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am new using QS, and I have difficult to create this exp.
let say I have database
Style Sales
A 100
B 50
C 20
D 250
and I want to create style group which are
Sales with 0 - 20 how many style
sales with more than 100 how many style.
Can you guys help me with this ?
Really appreciate with your help.
Thanks
Henry
Try using calculated dimension: If(Sales<=20, '<=20', if(Sales>=100, '>=100'))
Exp: Count(Style)
If the groups you want are evenly spaced then you could use the class function to create a calculated dimension.
However in this case, you would need to write a specific calculated dimension.
eg for what you want, the dimension would be
if(Sales<=20,'<=20',if(Sales>100,'>100','Other'))
This would create 3 dimensions, a group for 0-20 called '<=20',one for over 100 called '>100' and the rest lumped into a group called 'Other'.
I've attached a .qvf file as an example for you with your sample data simply counting how many are in each group.
Hi,
Implementing this in script is a best practice, try using below script
TableName:
LOAD
*,
If(Sales<=20, '<=20', if(Sales>=100, '>=100', 'N/A')) AS Range
FROM DataSource;
Now in chart use Range as dimension and Count(Style) OR Count(Distinct Style) as expression.
Regards,
Jagan.