Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
antonaks
Creator II
Creator II

The condition in expression

Hello colleagues
I have a question on the condition in the expression diagrams.
There are fields in the table:
FILIALS
SUM_PLAN
SUM_FACT

I need to count those branches in which sales = 0, and plans> 0

Is it possible to include such a condition in the Set Analysis?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be this?

Count(distinct {<SUM_FACT={'>0'}, SUM_PLAN={'0'}>}FILIAL)

View solution in original post

9 Replies
tresesco
MVP
MVP

Which fields have sales, plan, branch info? Could you be a bit more illustrative about your field details and may be also about the requirement?

antonaks
Creator II
Creator II
Author

The dataset is look like that   

FILIAL / BRANCHSUM_PLANSUM_FACT
branch 1639177
branch 2761347
branch 3563457
branch 41790
branch 5506166
branch 68290
branch 7583749
branch 800
branch 9778327

I want create expression which return quantity of branches where FACT = 0 and PLAN > 0

In my case it must return 2

Chanty4u
MVP
MVP

try this script

A:

LOAD *

Where

SUM_PLAN>'0' and SUM_FACT='0' ;

LOAD * INLINE [

    FILIAL, SUM_PLAN, SUM_FACT

    branch1, 639, 177

    branch2, 761, 347

    branch3, 563, 457

    branch4, 179, 0

    branch5, 506, 166

    branch6, 829, 0

    branch7, 583, 749

    branch8, 0, 0

    branch9, 778, 327

];

plan.PNG

antonaks
Creator II
Creator II
Author

Thank you Chanty 4u, but I want create it in diagramm, if it possible.

Chanty4u
MVP
MVP

Diagram means?

tresesco
MVP
MVP

May be this?

Count(distinct {<SUM_FACT={'>0'}, SUM_PLAN={'0'}>}FILIAL)

antonaks
Creator II
Creator II
Author

Yes, sorry...

Chanty4u
MVP
MVP

Not tested

try this

A:

//LOAD *

//Where

//SUM_PLAN>'0' and SUM_FACT='0' ;

LOAD * INLINE [

    FILIAL, SUM_PLAN, SUM_FACT

    branch1, 639, 177

    branch2, 761, 347

    branch3, 563, 457

    branch4, 179, 0

    branch5, 506, 166

    branch6, 829, 0

    branch7, 583, 749

    branch8, 0, 0

    branch9, 778, 327

];

Result:

LOAD *

,

if(SUM_PLAN='0',SUM_FACT>'0' ) as flag

Resident A;

use flag in chart measure

antonaks
Creator II
Creator II
Author

Yes, it work! Thank you!