Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Show values A, B, C of a column as one value called X

Hi,

Anybody can help me figure out this.

I have a chart with dimintion XX

the values on this diminsions are A, B, C, D

is there anyway I can show the values B, C, D as X and keep A as it

.....................................................................................................

example the chart table is like

XX     Total

A       8

B       6

C       4

D       10

I want it to show up like

XX

A      8

X       20

Thxs

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe using something like this in your expression:

=sum( if(GG='QQ', SalesValue))

if you want to aggregate SalesValue field (or just replace this field with some other).

You could also use set expression to simulate a selection in field GG:

=sum({<GG={QQ}>} SalesValue)

View solution in original post

9 Replies
swuehl
MVP
MVP

Alex,

try a calculated dimension like

=if(XX='A',XX,'X')

You could add a field pretty much the same as above in your load script to avoid using a calculated dimensions with large data.

alec1982
Specialist II
Specialist II
Author

Thank you. and how about the others

should I type = if(XX='A','B','C',XX,'X')?

Thanks

alec1982
Specialist II
Specialist II
Author

Sorry for the miscommunication, this is working but I wanted to keep A and C as it and change B and D to other

Thanks

swuehl
MVP
MVP

=if(match(XX,'A','C'),XX,'X')

MayilVahanan

hi,

     Try this,

   =  If(Match(XX,'A','C'),XX,'X')

Hope it helps u,

R.Mayil vahanan

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
alec1982
Specialist II
Specialist II
Author

This seems to be working.

May I ask you for one more thing..

On a chart with the same diminssion =if(match(XX,'A','C'),XX,'X')

is it possible to consider a value from another field.

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

On another fieldcalled GG I have one of the values called QQ

how can I write something inside the expression to consider this value as selected within this chart

I really appreciate your help.

Thxs

swuehl
MVP
MVP

Maybe using something like this in your expression:

=sum( if(GG='QQ', SalesValue))

if you want to aggregate SalesValue field (or just replace this field with some other).

You could also use set expression to simulate a selection in field GG:

=sum({<GG={QQ}>} SalesValue)

MayilVahanan

hi,

     if ur question is, check whether  a value in a field is selected or not . try this,

= if(GetFieldSelections(GG) = 'QQ', 1, 0)

or

in expression,

= Sum({<GG={'QQ'}>Sales}

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
alec1982
Specialist II
Specialist II
Author

Thanks Guys!