Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

Anonymous
Not applicable
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 III
Champion III

Load

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

FROM TABLE

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

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

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 ;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Hi Aehman,

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

Anonymous
Not applicable
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.

Anonymous
Not applicable
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 ;