Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Creator III
Creator III

Can anyone help me in writing expression for chart?

Hi All,

my table is

2.PNG

my edit script code is below:

Temp:

LOAD EMPNAME,

PRIORITY,

STATUS_CODE,

STATUS,

DUE_DATE,

Num(Today()-Date(DUE_DATE)+1) as NOD

From

Overdue:

LOAD *,

If(NOD = 0, ' 0 Days',

if(NOD <= 2,'1-2 Days',

if(NOD <= 5,'3-5 Days',

if(NOD <= 10,'6-10 Days',

if(NOD <= 15,'11-15 Days', '15+ Days'))))) as Overdue

Now my challenges to display data on below conditions:

* Employee must have status approved or closed or pending or waiting.

* Employee status code not to be CS05

* finally i need to get details by overdue days (based on NOD defined in edit script).

I am expecting below output with more overdue categories based on above conditions.

2.PNG

Can any one please help me to doing this pie chart. This is highly appreciated.

Thanks,

Durga

1 Solution

Accepted Solutions
Partner
Partner

Hi Durga,

// This is the script I've used, default western european settings with adjusted DateFormat 'M/D/YYYY'

SET ThousandSep='.';

SET DecimalSep=',';

SET MoneyThousandSep='.';

SET MoneyDecimalSep=',';

SET MoneyFormat='€ #.##0,00;€ -#.##0,00';

SET TimeFormat='h:mm:ss';

SET DateFormat='M/D/YYYY';

SET TimestampFormat='D-M-YYYY h:mm:ss[.fff]';

SET MonthNames='jan;feb;mrt;apr;mei;jun;jul;aug;sep;okt;nov;dec';

SET DayNames='ma;di;wo;do;vr;za;zo';

mydata:

LOAD *,

If(NOD <= 0, ' 0 Days',

if(NOD <= 2,'1-2 Days',

if(NOD <= 5,'3-5 Days',

if(NOD <= 10,'6-10 Days',

if(NOD <= 15,'11-15 Days', '15+ Days'))))) as Overdue

;

Load *,

    Today()-(Date(DUE_DATE)+1) as NOD

;

LOAD * INLINE [

    EMPNAME, PRIORITY, STATUS_CODE, STATUS, DUE_DATE

    Admin, -, , Aprooved, '6/24/2010'

    Admin, -, , Pending, '7/31/2014'

    Admin, -, , Waiting, '3/21/2015'

    Pavan, High, CS05, Aprooved, '3/25/2015'

    Pavan, High, CS06, Closed, '3/15/2015'

    Ramesh, Low, CS16, Aprooved, '3/27/2015'

];

View solution in original post

7 Replies
Partner
Partner

Hi Durga,

See attachment.

Grtz Fred

Creator III
Creator III

Hi Fred,

Thanks for response!

Can you please share screenshots what you did.

I have no access to download and upload .qvw files due to security reasons.

Waiting for reply! It is very helpful to my dashboard.

Thanks,

Durga


Creator III
Creator III

Is NOD field populating correctly?


The expression for the chart would be:

Count({<STATUS = {'approved','closed','pending','waiting'}, STATUS_CODE -= {'CS05'}>} NOD)

Creator III
Creator III

NOD field is populating correctly?

what is my dimesion if the above is expression?

Durga

Partner
Partner

Hi Durga,

// This is the script I've used, default western european settings with adjusted DateFormat 'M/D/YYYY'

SET ThousandSep='.';

SET DecimalSep=',';

SET MoneyThousandSep='.';

SET MoneyDecimalSep=',';

SET MoneyFormat='€ #.##0,00;€ -#.##0,00';

SET TimeFormat='h:mm:ss';

SET DateFormat='M/D/YYYY';

SET TimestampFormat='D-M-YYYY h:mm:ss[.fff]';

SET MonthNames='jan;feb;mrt;apr;mei;jun;jul;aug;sep;okt;nov;dec';

SET DayNames='ma;di;wo;do;vr;za;zo';

mydata:

LOAD *,

If(NOD <= 0, ' 0 Days',

if(NOD <= 2,'1-2 Days',

if(NOD <= 5,'3-5 Days',

if(NOD <= 10,'6-10 Days',

if(NOD <= 15,'11-15 Days', '15+ Days'))))) as Overdue

;

Load *,

    Today()-(Date(DUE_DATE)+1) as NOD

;

LOAD * INLINE [

    EMPNAME, PRIORITY, STATUS_CODE, STATUS, DUE_DATE

    Admin, -, , Aprooved, '6/24/2010'

    Admin, -, , Pending, '7/31/2014'

    Admin, -, , Waiting, '3/21/2015'

    Pavan, High, CS05, Aprooved, '3/25/2015'

    Pavan, High, CS06, Closed, '3/15/2015'

    Ramesh, Low, CS16, Aprooved, '3/27/2015'

];

View solution in original post

Partner
Partner

Dimension: Overdue

Expression: =count(DUE_DATE)

Overdue.JPG

Creator III
Creator III

Hi Mike,

Yours solution also gives correct output.

Durga