Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I wanted to categorize and label the value of the cheque amount into group like 0 - 300, 301-600, 600 & over. Is there any ways to go about doing it. I tried to using the expressions below but it doesn't seems to work.
My tables:
Date | cheque_amt |
01/03/2014 | 200 |
01/03/2014 | 500 |
01/03/2014 | 600 |
02/03/2014 | 300 |
02/03/2014 | 400 |
02/03/2014 | 700 |
03/03/2014 | 300 |
03/03/2014 | 800 |
03/03/2014 | 500 |
Expression 1:
= if(cheque_amt>0 and cheque_amt<=300) as 0-300 Or
if(cheque_amt>301 and cheque_amt<=600) as 301-600 or
if(cheque_amt>601 ) as >600
Expression 2:
=If( cheque_amt>0 and cheque_amt<=300, 0-300
If( cheque_amt>301 and cheque_amt<=600, 301-600,
If( cheque_amt>601, >600)))
Hi,
After loading this table take straight table and in
Dimension 1: take date field
Dimension 2: take Bucket field
and in expression write
Expression =sum(cheque_amt)
Hope this helps
Thanks & Regards
try with class function
Hi,
Create a Bucket like this
Temp:
load * Inline
[
Date, cheque_amt
01/03/2014, 200
01/03/2014, 500
01/03/2014, 600
02/03/2014, 300
02/03/2014, 400
02/03/2014, 700
03/03/2014, 300
03/03/2014, 800
03/03/2014, 500
];
load
*,
if(cheque_amt > 0 and cheque_amt <= 300, '0-300',
if(cheque_amt > 301 and cheque_amt <= 600, '301-600',
if(cheque_amt > 601,'>600'))) as Bucket
Resident Temp;
DROP Table Temp;
Hope this helps
Thanks & Regards
Hi,
After loading this table take straight table and in
Dimension 1: take date field
Dimension 2: take Bucket field
and in expression write
Expression =sum(cheque_amt)
Hope this helps
Thanks & Regards
Hi Anand, thanks for your reply. I tried to load inline script that you had given but it appears to have some error while loading. Could it due to the reason that I used the same source data from the table:
FROM
C:\.......\data.xls
(biff, embedded labels, table is
[Sheet2$]);
Hi,
Yes make changes according to your data location or if you refer my inline code then make changes in your script. Because my table is inline table.
Hope this helps
Thanks & Regards
Hi,
Your Expression 2 is similar but make some changes check here
If( cheque_amt>0 and cheque_amt<=300, '0-300',
If( cheque_amt>301 and cheque_amt<=600, '301-600',
If( cheque_amt>601, '>600'))) as Bucket
You can use this script in your load script
Hope this helps
Thanks & Regards
Thanks Anand!! It works now. Really appreciated your help.
Cheers=)