Focal Point
[Solved]Appending(not happening as expected) ID's and passing it to fex

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2737013196

May 16, 2019, 11:50 AM
srajeevan
[Solved]Appending(not happening as expected) ID's and passing it to fex
Hi,

I am trying to store 3 values separated by OR as an ID column and a description field next to it.

For ex:
I have the data in the below format.
  
PID   PNAME
0010  Product1
0011  Product2
0015  Product3
0016  Product3
0018  Product3
0017  Product4


As you can see I have three IDs for Product3.

I have a fex i use to display the product filer values and i pass ID's as value and PNAME as display.
since i have 3 PIDs for Product3,it gets repeated 3 times.
But i want to display Product3 one time only and when i select Product3 ,i should pass PID as '0015' OR '0016' OR '0018'

I can create another define field to create a unique id,but i was trying to modify the product filer fex alone to pass all the three values together ,as that is an easy fix.
I have around 100 reports which uses this filter,i don't want to make change in all those unless it is necessary.

My attempt.
  
DEFINE FILE PRODUCTS
DEF_PID/A100V = IF PID EQ '0015' THEN '0015'||' OR '||'0016'||' OR '||'0018'
ELSE IF PID EQ '0016' THEN '0015'||' OR '||'0016'||' OR '||'0018'
ELSE IF PID EQ '0018' THEN '0015'||' OR '||'0016'||' OR '||'0018'
ELSE PID
END
TABLE FILE PRDOUCTS
SUM
PNAME
BY DEF_PID
END

This should work i think.
But when it does the append operation,
i get the below output.
 
DEF_PID                  PNAME

0010                 Product1
0011                 Product2
0015 OR0016 OR0018   Product3
0017                 product4
 

First Issue : Append is not happening properly.
Second Issue :When i pass the PID to another fex,i should have single quotes for the DEF_PID(i can do that using QUOTEDSTRING) but how can i do that for the appended DEF_PID.

This message has been edited. Last edited by: srajeevan,


WF8206,Windows 7,8,10
HTM,PDF,EXCEL
May 16, 2019, 04:47 PM
Doug
First Issue: Double Bars, '||', are STRONG concatenations. You want a WEAK Concatenation so use a Single Bar: '|'.

Second Issue: Try surrounding the concatenated string with three, or should that be four single quotes.
May 21, 2019, 02:36 PM
srajeevan
Hi Doug,

I was careless in using || string concatenation instead of |.
Was able to solve both issues.
Thanks


WF8206,Windows 7,8,10
HTM,PDF,EXCEL