Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Expression In Script

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

1 Solution

Accepted Solutions
Highlighted

24 Replies
Highlighted

May be something like this:

LOAD Count(Status),

          ChartDimensions

Resident ...

Group By Chart Dimensions

Where Status = 'Pended';

Highlighted
MVP
MVP

Yes but don't forget to use Group By in your script..

Highlighted
Creator III
Creator III

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

Highlighted
MVP
MVP

Data:

Load * From TableName;

Count:

Load COUNT(Distinct ID) as TotalCount;

Load ID Resident Data Where Status = 'Pended';

Highlighted

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';

Highlighted
Creator III
Creator III

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;

Highlighted

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?

Highlighted
Creator III
Creator III

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. 

Highlighted

What are the dimensions you are using in the chart?