Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld May 10-12, Online and Free! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
junasharma
Creator
Creator

Merge two rows??

Hi All,

I have a dimension DSI, which consists of two rows 1) null and 2)values less than 14.

I want to merge these two rows .

How can  do it??

I have other dimensions in the table which are exactly same except DSI??

Thanks Juna

11 Replies
MK9885
Master II
Master II

Merge as in include those values from other dimension like

Example1:

ABC     XYZ

1              2

3              4

to

ABCXYZ

1

2

3

4

or

Example2:

ABC

1,2

3,4 ?

I do not know how to achieve the first example but for 2nd example (values side by side) use

ABC& ' , ' &XYZ as ABCXYZ,

In the script use above syntax.

Perhaps you have a sample data or a screenshot or how you want it?

If someone can explain how to get the result for example 1 it will be helpful for me as well.

Thanks.

junasharma
Creator
Creator
Author

Hi,

This is the scenario I am talking about... I want to merge these two rows being based on DSI . First row is null and second will always have values les than 14 . Is there a way we can sum these two rows that results in one row?

   

ABDSIFLAGCMeasuresMeasures
12 Y000
125y0073
MK9885
Master II
Master II

If you trying to do this in front end, then use

only ({<DSI ={'*'}>} DSI)

This can be used in front end w/o editing the script.

is it like below image?

Capture.PNG

Data

Capture.PNG

But if you want to do it in script,

Data:

LOAD A,

     B,

     DSI,

     FLAG,

     C,

     Measures,

     Measures1

FROM

(biff, embedded labels, table is Sheet2$)

Where Len(Trim(DSI)) > 0 ;

vinieme12
Champion II
Champion II

Load

A,B,Flag,C,Measure,Sum (DSI),SUM (MEASURES)

FROM TABLE

GROUP BY A,B,Flag,C,Measure;

vinieme12
Champion II
Champion II

But if you don't want the null rows why  even bother with the aggregation just load rows wherw not isnull (dsi) or

len (trim(dsi))>0 ;

junasharma
Creator
Creator
Author

Hi Aehman,

Rows are merged but I see null values in DSI. Also I can do this only from frontend.

junasharma
Creator
Creator
Author

Hi Vineeth,

If u remember you helped me to create flag with two condition.

if(open orders=0,

    if( (DSI<14 and match(metric_key,4,5))             (this gives values less than 14)

    OR

    (match(metric_key,2,,6)),1,0),0) as flag            (this gives null values)

So for same flag, I m getting two rows in table for DSI which I have to merge from frontend.

junasharma
Creator
Creator
Author

Is it possible to sum  these two conditions itself in the flag  and include  if(open orders=0 too?

  if( (DSI<14 and match(metric_key,4,5))           

    (match(metric_key,2,,6)),1,0),0)          

MK9885
Master II
Master II

Find the attachment.

And again if you want it to be done in back end, use below script

Data:

LOAD A,

     B,

     DSI,

     FLAG,

     C,

     Measures,

     Measures1

FROM

(biff, embedded labels, table is Sheet2$)

Where Len(Trim(DSI)) > 0 ;