Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
cloud
New Contributor III

Concat 2 distinct values of a dimension with formatting

Hi all, 

I want to do this on a pivot table 

Count = 1,2

Score = A, B

Concat score and Count to become like this:

A-1, B-2

on a cell in pivot table. 

Currently my set expression is 

Concat(DISTINCT Score & Count, ',') 

 

Appreciate any help. please don't send qlikview files and type in the example instead. thanks. 

Labels (3)
5 Replies
Masi_Sahargahi
New Contributor III

Re: Concat 2 distinct values of a dimension with formatting

You can consider an "id" field for any row which you want to concat:
like :
Count:
load * inline
[
id,f1
1,1
2,2
];

Score:
load * inline
[
id,f2
1,A
2,B
];
cloud
New Contributor III

Re: Concat 2 distinct values of a dimension with formatting

Hi Masi,
it should be dynamic. I can only use set expression to do the concat.
vsr_shimla
New Contributor II

Re: Concat 2 distinct values of a dimension with formatting

Hi,

If you  only want to concat values you can try this:

LOAD Distinct Score&'-'&Count as NewFeild,* INLINE [
Count, Score
1, A
2, B
];

Or write this  as an expression Score&'-'&Count  in your Pivot Table  loading Score and Count dimensions

Regards

 

cloud
New Contributor III

Re: Concat 2 distinct values of a dimension with formatting

I've tried Score&'-'&Count but it shows me this result:
-, A-1, B-2
there's extra hyfen and comma before the score. how do I remove this
vsr_shimla
New Contributor II

Re: Concat 2 distinct values of a dimension with formatting

Post more data that you are trying to load