Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sspawar88
Creator II
Creator II

Issue in Stack Bar Chart

Hi Community,

I used  Bar chart &

1)dimension-->branch_type

2)calculated dimension-->

if(match(branch_type,'DEPOT','FACTORY','PT','ST'),

(

if(Flag='RED','1',

if(Flag='YELLOW','2',

if(Flag='AMBER','3',

if(Flag='GREEN1','4'

))))))

----------------------------------------------------------------------------

RED--->param_value=<=-1 and param_value=>=-10

YELLOW--->param_value=<=-10.1 and param_value=>=-13.9

AMBER--->param_value=<=-14 and param_value=>=-17.9

GREEN--->param_value=<=-20

(Above are only names of color which are taken by creating Flag in script)

----------------------------------------------------------------------------

3) Expression

Count({$<param_name={'TEMP'},param_value={'<=-1'}>}param_value)/

Count(total <branch_type>{$<param_name={'TEMP'},param_value={'<=-1'}>}param_value)*100

it gives 400% which is wrong.

11111.PNG

it should be 100% and there are diffrerent proportion for stacks for each branch_type


12 Replies
Not applicable

Hello

Could you send a qvd ?

sspawar88
Creator II
Creator II
Author

qvd?

you mean sample QVW

awhitfield
Partner - Champion
Partner - Champion

Ha ha,

looks like Qlik Sense to me, so it's a ,qvf 

Andy

sspawar88
Creator II
Creator II
Author

yes andy

but it won't work out in qv and Qs too.

awhitfield
Partner - Champion
Partner - Champion

which ever; are you uploading one of them?

Andy

sspawar88
Creator II
Creator II
Author

Actually i'm working in Qlik sense.

but whenever i came across difficulty in my apps i put same data in QV and QW for get solution for a sample data.

awhitfield
Partner - Champion
Partner - Champion

OK, please upload either an example qvw OR qvf

Andy

sspawar88
Creator II
Creator II
Author

ok

mphekin12
Specialist
Specialist

Why don't you set the flag color in the load script?  Something like:

if(param_value<=-1 and param_value>=-10, 'RED',

if(param_value<=-10.1 and param_value>=-13.9, 'YELLOW',

  if(param_value<=-14 and param_value>=-17.9, 'AMBER',

   if(param_value<=-20, 'AMBER',

   )

  )

)

) as param_color;