Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 3 fields (i.e customer ID,travel_route,prize) like below table
load * inline [
customer ID, travel_route, Prize
1, france,1000$
1,India,200$
1,USA,500$
2,sweden,400$
2,Netherland,600$
2,Finland,700$
3,Australia, 600$
3,Canada,300$
];
Now I need the count of the number of customer travelled (i.e. 3), and number of travel routes (3 for customer id 1, 3 for customer id 2 and 2 for customer id 3 ), could anyone please help with this query
@GOKULAKANNAN if I understand correctly
for the first:
=count(distinct [customer ID])
for the second [customer ID] as a dimension and count(distinct travel_route) as measure
@GOKULAKANNAN If you are looking something at the script level. You can try the below code.
NoConcatenate
Temp:
load * inline [
customer ID, travel_route, Prize
1, france,1000$
1,India,200$
1,USA,500$
2,sweden,400$
2,Netherland,600$
2,Finland,700$
3,Australia, 600$
3,Canada,300$
];
NoConcatenate
Temp1:
Load count(distinct [customer ID]) as Total_Customer
Resident Temp;
NoConcatenate
Temp2:
Load Count(distinct [travel_route]) as Total_travel_routes,
[customer ID]
Resident Temp
group by [customer ID];
Exit Script;
I just need to do this in script itself, i need only count
in KPI Take Measure as count(distinct [customer ID]) And Label it to Total customer
now take a Bar
in DImension Take CUstomerID
and In Measure
Count( distinct Route)
see the attched file