Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

counting expressions

Hi i would like to be able to create a stack chart out of an expression column which shows values -1 and 0. (see screenshot)

-1 = red & 1 = green

is it possible to count these expressions to receive an amount for both values and represent them in a piechart?

the actual values represent SLA Level measurements if a a case has met the time requirements or not.

a picture reference is attached to this post.

//Best

Bradley

1 Solution

Accepted Solutions
whiteline
Honored Contributor II

Re: counting expressions

Ok, I see =)

It's a bit monstrous, cause you have a rather complex expression:

=Count({<Ärende_ID={"=((NetWorkDays(Created,[Updated])- IF(Frac([Updated]) < Time#('17:00','hh:mm'),1,0)-IF(Frac([Updated]) >  Time#('17:00','hh:mm'),1,0)- IF(Frac(Created) > Time#('08:00','hh:mm'),1,0) - IF(Frac(Created) < Time#('08:00','hh:mm'),1,0))*8+ RangeMax(((Time#('17:00','hh:mm') - Frac(Created))*24),0)+ RangeMax(((Frac([Updated]) - Time#('09:00','hh:mm'))*24),0)) > SLAend"}>} Ärende_ID)

I think you could consider to make some calculations in script to simplify it.

And just to get better understanding what it is doing (this one is not working but looks much easier):

=Count({<Ärende_ID={"=[Total Hours]>SLAend"}>} Ärende_ID)

10 Replies
whiteline
Honored Contributor II

Re: counting expressions

Hi.

Use set analysis:

=Count({<Visual={"-1"}>} Visual)

Not applicable

Re: counting expressions

Thanks for the reply.

i have tried with the code provided, however recieve the following message; Bad fieldname(s); Visual;

any tips;

Brad

whiteline
Honored Contributor II

Re: counting expressions

Obviously, you should change the expression according to your field names.

I guess that Visual is a field name.

Not applicable

Re: counting expressions

Hi.

the expression name is Visual. but it carries no real pre-defined field name.

is it still possible to calculate values from an expression?

Not applicable

Re: counting expressions

Thank you for your reply.

The expression is named Visual.

Is it possible to still count values if the data is derived from an expression and not a true field name?

whiteline
Honored Contributor II

Re: counting expressions

It's possible. But you have to use some dimension to perform such selection (as if it's done manually), for example:

=Count({<Dimension={"=(Your expression for Visual)=-1"}>} Dimension)

Not applicable

Re: counting expressions

Hi.

Thank you kindly once again.

I have tried to establish this logic into my application however, it seems to show error.

I was wondering If I attach my application to this mail, would it be possible for you to take a look at my dimension?

Your help would be greatly appreciated in this matter.

Best,

Brad

whiteline
Honored Contributor II

Re: counting expressions

Ok, I see =)

It's a bit monstrous, cause you have a rather complex expression:

=Count({<Ärende_ID={"=((NetWorkDays(Created,[Updated])- IF(Frac([Updated]) < Time#('17:00','hh:mm'),1,0)-IF(Frac([Updated]) >  Time#('17:00','hh:mm'),1,0)- IF(Frac(Created) > Time#('08:00','hh:mm'),1,0) - IF(Frac(Created) < Time#('08:00','hh:mm'),1,0))*8+ RangeMax(((Time#('17:00','hh:mm') - Frac(Created))*24),0)+ RangeMax(((Frac([Updated]) - Time#('09:00','hh:mm'))*24),0)) > SLAend"}>} Ärende_ID)

I think you could consider to make some calculations in script to simplify it.

And just to get better understanding what it is doing (this one is not working but looks much easier):

=Count({<Ärende_ID={"=[Total Hours]>SLAend"}>} Ärende_ID)

Not applicable

Re: counting expressions

Thank you for your help. It came at a very needy time and now I understand how the logic should be applied to further applications.

You know Qlikview is extremely powerful once you understand the mechanics behind it all.

I am an avid SAP BW consultant but find myself more and more convinced of Qlikview.

Have a great week.

//Brad

Community Browser