Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the below expression in the chart properties and I would like to add in the scrip. Can someone show me the best approach?
Expression in Chart - count({<Status={[Pended]}>}distinct ID)
how would that look in the scrip? Can I use a IF Statement, this is what I have below...
Count(IF(Status= 'Pended','')) as TotalPends
Here you go
May be something like this:
LOAD Count(Status),
ChartDimensions
Resident ...
Group By Chart Dimensions
Where Status = 'Pended';
Yes but don't forget to use Group By in your script..
Count(IF(Status= 'Pended',distinct ID ) as TotalPends
I want to count distinct ids when a status = pended
Not sure how that would look in the script
Data:
Load * From TableName;
Count:
Load COUNT(Distinct ID) as TotalCount;
Load ID Resident Data Where Status = 'Pended';
And if there is a particular dimension on which you want the count, then may be this:
Data:
Load * From TableName;
Count:
Load Dimension,
COUNT(Distinct ID) as TotalCount;
Load ID Resident Data
Group By Dimension
Where Status = 'Pended';
I'm hoping the expression can be created within the initial load with Ifs
I have...
Table:
Load
xxxx,xxxx,xxx,xxx
//(Hundereds of Columns)
Count(distinct ids) as TotalIds,
Count(DISTINCT if(Status='Pended')) as TotalPends , (The syntax is not right)
xxxx
FROM
Group by
xxxx,xxxx,xxx,xxx xxxx;
I think it would be better to left join your result back to the original table, because I don't think this would work the way you are doing:
1st of all are you doing a overall count of ids where status is pending? or on a particular dimension or dimensions?
I'm trying to remove the expression that's in my chart count({<Status={[Pended]}>}distinct ID) and add into my script as an If statement but it seems that's not the best approach and may not be possible.
What are the dimensions you are using in the chart?