Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
beginner91
Contributor III
Contributor III

pie chart if count words

hello all,

i have a excel file with dimension: Phase and want a pie chart.  I want to show all 3 together like:

if(Phase='hello' and 'hi' and 'hey', 'hello')

i need some help at the expression. how can i show all 3 together in one hello??

thanks.

 

Labels (2)
5 Replies
Vegar
MVP
MVP

I'm not completely sure I understand your problem, but I'll give it a try.

You want the values hello, hi and hey to be handled as hello? You do not want any hi or hey to be found in your application data?

If yes try using applymap()

PhaseMap:
Mapping load * inline [
PhaseOrig, phaseNew
hi, Hello
hey, Hello
hello, Hello
];

LOAD
Apply map( 'PhaseMap', Phase, Phase) as Phase
FROM
ExcelFile.xlsx
;
beginner91
Contributor III
Contributor III
Author

i have something like this:

phase

a

b

hello

hi

hey

and i want to show a pie chart with: a,b, and (hello,hi,hey) as hello

 

pradosh_thakur
Master II
Master II

Try below as dimesnion

 

If(Phase='hi' or Phase='hello' or Phase='hey','hello',Phase)

 

Learning never stops.
pradosh_thakur
Master II
Master II

or this

pick(match(Phase,'hi','hello','hey')+1,Phase,'hello','hello','hello')
Learning never stops.
Vegar
MVP
MVP

//a mapping table used to convert hi, hey into hello.
// you may expand this to other convertions as well

PhaseMap:
MAPPING load * inline [
PhaseOrig, phaseNew
hi, Hello
hey, Hello
hello, Hello
];

LOAD
Apply map( 'PhaseMap', Phase, Phase) as Phase,
1 as #count
FROM
ExcelFile.xlsx
;

In your chart put "Phase" as your dimension and =sum(#count) as your expression.