Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to give an own-given name to certain data which meets the conditions?
e.g.
Country, Customer, qty Customer Orders
Netherlands, A, 5
Netherlands, B, 7
Netherlands, C, 8
Belgium, N, 8
Belgium, O, 5
Belgium, P, 6
Germany, Q, 7
Germany, R, 7
Germany, S, 9
Condition is:
- if there are customers who have 8 or more than 8 customer orders, then I want to give that customer the name HEAVY (instead of their own customer name).
- Customers which have 6, more than 6, but less than 8 customer orders, should have the name MEDIUM (instead of their own customer name)..
- Customers whith less then 6 customer orders should have the name NORMAL (instead of their own customer name)..
Is this possible?
Kind regards,
ZR
HI,
Use below script
TableName:
LOAD
Country,
Customer,
QtyOrders,
If(QtyOrders >= 8, 'HEAVY',
If(QtyOrders >= 6 AND QtyOrders < 8, 'MEDIUM',
If(QtyOrders < 6, 'NORMAL'))) AS OrderSize
FROM Datasource;
Hope this helps you.
Regards,
Jagan.
You can use conditional if() functions to do this, like
INPUT:
LOAD Country, [qty Customer Orders],
if([qty Customer Orders] >=8, 'HEAVY',
if([qty Customer Orders] >=6, 'MEDIUM', 'NORMAL')) as Customer
INLINE [
Country, Customer, qty Customer Orders
Netherlands, A, 5
Netherlands, B, 7
Netherlands, C, 8
Belgium, N, 8
Belgium, O, 5
Belgium, P, 6
Germany, Q, 7
Germany, R, 7
Germany, S, 9
];
Is it also possible to change it in the condition of an expression?
Hi,
Please use the below expressions for Heavy, Medium and Normal
Heavy = Count({<[qty Customer Orders] ={'>=8'}>} Customer)
Medium =Count({<[qty Customer Orders] ={'>=6<8'}>} Customer)
Normal=Count({<[qty Customer Orders] ={'<6'}>} Customer)
Hope this helps you.
Regards,
Jagan.
I have tried, when entering above condition in the expression, it says:
"Garbage after 'Heavy'"
Hi,
Did you used the above in Load Script? If yes, use this script as Chart Expressions in chart not in Load script.
Can you attach a sample file.
Regards,
Jagan.
Hi,
No, I have used your script in the Edit Expression in the tab Expressions of the chart... so that should be ok.
It's a bit hard to attach a sample file, because there is company information in it.
How can we solve this?
Btw, thank you for your effort.
Regards,
ZR
Hi,
I attched a sample QV file. May be its helpful for u.
Regards,
Iyyappan
Thank you, it is helpful, but I'm still not there, because I want to show the data in a pie chart, or in a line chart. is that possible?