Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following
IF(turned = 'Yes',1,0) as [Countofturned],
IF(Initial = 'Denied',1,0)as [CountofDenied],
Div([Countofturned],[CountofDenied]) as [Percent]
Getting an error Countofturned does not exist. How can I write this in the script?
Maybe in a preceding LOAD?
LOAD *,
Div([Countofturned],[CountofDenied]) as [Percent];
LOAD
IF(turned = 'Yes',1,0) as [Countofturned],
IF(Initial = 'Denied',1,0)as [CountofDenied],
...
FROM ...;
You cannot reference field names in a LOAD that were created using AS in the same LOAD statement.
This is what I have so far, receiving an error.
table:
load allcolumns, IF(turned = 'Yes',1,0) as [Countofturned],
IF(Initial = 'Denied',1,0)as [CountofDenied]
tableA:
Join(table)
load Div([CountofOverturned],[CountofDenied]) as [Percent], ID
Resident table
group by ID ;
I'm gettting the below error, thoughts?
Aggregation expressions required by GROUP BY clause
May be try
Div (sum (field1),sum (field2)) as field
...
Or
Sum (field1)/sum (field2) as field
Need to SUM if then divide. See below.
IF(turned = 'Yes',1,0) as [Countofturned],
IF(Initial = 'Denied',1,0)as [CountofDenied],
Div([Countofturned],[CountofDenied]) as [Percent]
you need an aggregation function (sum, count, etc...) for the fields not in group by
Can I use a Resident table for my from. So,
LOAD *,
Div([Countofturned],[CountofDenied]) as [Percent];
LOAD
IF(turned = 'Yes',1,0) as [Countofturned],
IF(Initial = 'Denied',1,0)as [CountofDenied],
...
Resident ...;
May be this.. instead of join
Table :
Load yourfields,
Div (if (turned='Yes',1,0),if (turned='Denied',1,0) as percent
Source;
I do not have this issues resolved. I have the following set analysis, that works but trying to add this into my script. Any thoughts?
How can I add the below into a readable script?
count({<turned={[Yes]}>}distinct ID)/count({<Initial={[Denied]}>}AuthID)
You would need to perform an aggregation in the script.
Note that aggregations in the script will be static, not responding on user selections.
You need to load your tables with a GROUP BY clause and do filtering in WHERE clause, or IF() statement within your aggregation function.
To tell you more, you would need to tell us, in which tables turned, Initial, ID and AuthID fields are located and how these tables are linked.