Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extract Data into a Bar Chart

Hi,

I am trying to enter certain information into a bar chart.  I have a field called Fix Code and what I am looking to do, is depending on the first four letters of the fixcode, will represent what type of issue this is.

We have the following example information in the fixcode field:

FLT0-CRPR-RCL0-SSWO

FLT0-CRPR-RCL0-STNT

RQST-NS01-SS01-TTRT

RQST-FST-RRCL-THR1

What I am looking to do is if the first four letters = FLT0, we will call it Fault

If the first four letters are = RQST, we will call it Request.

I want a bar chart that displays the total amount of Fault (FLT0) calls and the total amount of Request Calls (RQST) together.

Therefore I am hoping my Bar Chart will show 2 columns one with Fault showing say 80 calls and one with Request showing say 200 calls.

Is this Possible?

1 Solution

Accepted Solutions
whiteline
Master II
Master II

I suggest

=pick(mixmatch(left([Fix Code],4), 'FLT0', 'RQST'), 'Fault', 'Request')

for calculated dimension (or load script formula).

So that you can easily expand it with other fixcodes in future

and don't miss other fixcodes (considering them as 'Request').

View solution in original post

8 Replies
m_woolf
Master II
Master II

Try using a calculated dimension something like this:

if(left([Fix Code],4) = 'FLT0','Fault','Request')

Not applicable
Author

Put a formula forit in the script. See attached.

Not applicable
Author

Hi mwoolf,

I have enter this as my calculated dimension, however it wont display any data as I have put nothing in my Expression.  What do I need to put in my expression.

jagannalla
Partner - Specialist III
Partner - Specialist III

Hi,

Please check the attached file.

Map1:

Mapping

LOAD * INLINE [

    Key, Value

    FLT0, Fault

    RQST, Request

];

Main:

LOAD RowNo() as ID, *,ApplyMap('Map1',Left(Fixcode,4)) as Fix;

LOAD * INLINE [

    Fixcode , Amount

    FLT0-CRPR-RCL0-SSWO,100

    FLT0-CRPR-RCL0-STNT,200

    RQST-NS01-SS01-TTRT,300

    RQST-FST-RRCL-THR1,400

];

- In st table add two expressions:

FaultCall ->      =Sum({<Fix={"Fault"}>}Amount)

RequestCall -> =Sum({<Fix={"Request"}>}Amount)

m_woolf
Master II
Master II

coount(WhatEverFieldYouWantToCount)

Not applicable
Author

Hi rebeccad

I only have a Personal Edition Licence and have used my 4 attempts, so I am unable to view your Qlikview File.

Regards,

Jon

whiteline
Master II
Master II

I suggest

=pick(mixmatch(left([Fix Code],4), 'FLT0', 'RQST'), 'Fault', 'Request')

for calculated dimension (or load script formula).

So that you can easily expand it with other fixcodes in future

and don't miss other fixcodes (considering them as 'Request').

Not applicable
Author

No worries. I suggested adding the following to your script:

if(left([Fix Code],4) = 'FLT0','Fault','Request') As FixCodeField

Then you can just build the graph like you normally would, but with the new field.