Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to create a load script to reduce COMPETITOR field which have 41 value label to 2 value lable in list box ?

Hi All

I have 2 fields.

COMPETITOR have 41 value label.

I have another field which is COMPETITOR_FLAG  which only have 3 value label.

when i select COMPETITOR_FLAG = G

IT will filter 2 value label from COMEPTITOR field.

My question is how can i using load script expression  ,  look some thing like below :-

if ( COMPETITOR_FLAG = G , COMPETITOR) AS COMPETITOR_G,

so when i idsplay COMPETITOR_G field it will display 2 competitor on the list box.

if possible avoid partial reload.

Paul

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Sorry did not get you exactly. What is the issue here, What is happening when you used your If statement like below is it not working?

You want only two values from all the IF statements or Two values only when COMPETITOR_FLAG = G ?

LOAD * ,

         if ( COMPETITOR_FLAG = 'G' , COMPETITOR) AS COMPETITOR_G,

         if ( COMPETITOR_FLAG = 'C' , COMPETITOR) AS COMPETITOR_C,

         if ( COMPETITOR_FLAG = 'S' , COMPETITOR) AS COMPETITOR_S;

LOAD

        COl1,

        Col2,

.........

FROM ......... ;

View solution in original post

7 Replies
paulyeo11
Master
Master
Author

my qvw

vishsaggi
Champion III
Champion III

Sorry did not get you exactly. What is the issue here, What is happening when you used your If statement like below is it not working?

You want only two values from all the IF statements or Two values only when COMPETITOR_FLAG = G ?

LOAD * ,

         if ( COMPETITOR_FLAG = 'G' , COMPETITOR) AS COMPETITOR_G,

         if ( COMPETITOR_FLAG = 'C' , COMPETITOR) AS COMPETITOR_C,

         if ( COMPETITOR_FLAG = 'S' , COMPETITOR) AS COMPETITOR_S;

LOAD

        COl1,

        Col2,

.........

FROM ......... ;

paulyeo11
Master
Master
Author

Thank you very much , this is what i want.

paulyeo11
Master
Master
Author

Hi Vish

I have one new requirement , How to make COMPETITOR =  iTDS appear in all list box ?

I have mark COMPETITOR_FLAG = A for COMPETITOR = iTDS

Now my list box for COMPETITOR_R AND COMPETITOR_S , Does not display iTDS

May i know how to modify the expression ?

I guess it should be some thing like below :-

         if ( COMPETITOR_FLAG = 'R' & COMPETITOR_FLAG='A' , COMPETITOR) AS COMPETITOR_R,

         if ( COMPETITOR_FLAG = 'S' & COMPETITOR_FLAG='A' , COMPETITOR) AS COMPETITOR_S;

i Need to use COMPETITOR_FLAG , because there are more then 1 company iTDS .

But it not work.

Paul

paulyeo11
Master
Master
Author

MY QVW

vishsaggi
Champion III
Champion III

Does this data comes from any data source or your are manually populating in an excel sheet.

If yes, just add another row like iTDS and give the Flag R and S so you have to add two rows in your excel sheet like below.

COMPETITORCOMPETITOR_FLAT

iTDS                       S

iTDS                       R

Then reload the data. It will come in both the list boxes.

paulyeo11
Master
Master
Author

‌Hi Vish

YOu are right , the data source from excel , which I can add the S and R .

thank you it work

paul