Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
Please see what is wrong with my syntax, This exact formula works on the frontend but doesnt work in the script. No idea why,
Script below:
RAWTABLE:
Load Ticket Typ,
RecSite
.......
Load Count([Ticket Typ]) as TotalClaims,
if(mid(RecSite,2,1)='F','Franchise','Corporate') as Type
Resident RAWTABLE;
Formula in question is in bold.
Function seems to be fine, though I do get the idea your are missing a "group by" to make that count work.
You cannot use a Count() aggregation function and an individual field-that-isn't present-in-a-GROUP-BY clause in the same load. In addition to that, there is no GROUP BY clause. What are you planning to do?
All i need the count for is to do calculations on the frontend (Percentages). So il just remove the code from the script and add it to the frontend.
For that I suggest you do that Type calculation (that IF statement) in your script and do the count in the front-end anyway.
The expression to calculate your percentage will be something like this:
count([Ticket Type]) / count(TOTAL [Ticket Type]
1.we need to use Group By in script when we are using aggregating functions like SUM,MIN,MAX,COUNT....
2.in group by we have to use all the dimensions using in the load statement.
3.for example:
LOAD COUNTRY,
REGION,
SUM(POPULATION)
FROM TABLE.QVD
GROUP BY COUNTRY,REGION;
Hi
Add Count([Ticket Typ]) in front end and keep you expression in script as it is.
If you want to do it in script use by Groupby .
load
if(mid(RecSite,2,1)='F','Franchise','Corporate') as Type
Resident RAWTABLE
;