Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Merging data

I need to merge data in pivot table, for example:

Grade "A" + Grade "CYA" = A+

Grade "B" + Grade "CYB" = B+

i want to merge all value in one expression.

i use this expression:

=if(Grade = 'A', 'A+',if(Grade='CYA','A+',if(Grade <> '', PurgeChar (Grade,''))))

to merge only one value A + CYA = A+

testd.png

1 Solution

Accepted Solutions
Gysbert_Wassenaar

I need to merge data in pivot table, for example:

Grade "A" + Grade "CYA" = A+

Grade "B" + Grade "CYB" = B+

Create a new field in the script that links the original grades to your new grades:

Grades:

LOAD * INLINE [

ReportGrade, Grade

A+, A

A+, CYA

B+, B

B+, CYB

...etc

];

Then use the new field ReportGrade as dimension in your bar chart.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

I need to merge data in pivot table, for example:

Grade "A" + Grade "CYA" = A+

Grade "B" + Grade "CYB" = B+

Create a new field in the script that links the original grades to your new grades:

Grades:

LOAD * INLINE [

ReportGrade, Grade

A+, A

A+, CYA

B+, B

B+, CYB

...etc

];

Then use the new field ReportGrade as dimension in your bar chart.


talk is cheap, supply exceeds demand
jagan
Luminary Alumni
Luminary Alumni

Hi,

Change you script like below

LOAD

*,

if(Grade = 'A', OR Grade='CYA','A+',

if(Grade = 'A', OR Grade='CYB','D+', Grade)) AS New_Grade

FROM DataSource;


Now use the new column New_Grade in dimension, this will merge the data as you expected.


Regards,

Jagan.



ahmar811
Creator III
Creator III

Write condition on Dimension like that for all grade

if(Grade = 'A' or Grade='CYA','A+',

if(Grade = 'A-' or Grade='CYA-','A-',

if(Grade = 'B-' or Grade='CYB-','B-',

if(Grade = 'B' or Grade='CYB','B',

if(Grade = 'B+' or Grade='CYB+','B+',

if(Grade = 'C' or Grade='CYC','C',Grade

))))))

i implemented on qvw file also

hope these help you