Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
I have data like this
load * inline [
prodcuts,sales,cardgroup
producta,100,cardA
productb,200,cardB
];
here the point I will create a chart with
products as dim
sum(sales) as expression
here I am expecting the thing is
I should have new field called Group
where Group should have data
Group
All
cardA
cardB
if user select on All from Group columns it should show me the data for both Producta and Productb
if he select on cardA then only product ... like wise other one
how to achieve this expect below way
t1:
load
products,
sales,
cardgroup,
cardgroup as Group
...... from qvd1
concatenate
t1:
load
products,
sales,
cardgroup,
'All' as Group
...... from qvd1
the above solution is working ,but I don't want the same table again for getting the all filter
One front end solution, May be this?
Required only in Backend
Then your way is correct only
Any other way ,
reason why asking is
if my qvd has 10 million records , for "All" flag again am loading 10 million records which I dislike
One possible solution may be this? Because, until unless you need only 3 static names. If need more that 20 then we can do same with For...Each..Loop
Sample:
Mapping Load * inline [
prodcuts,sales,cardgroup
producta,100,cardA
productb,200,cardB
];
Final:
// Auto Join / Auto Concatenate. Don't require to declare any Keyword between directories.
Load products, sales, 'All' as Group, Applymap('Sample', cardgroup, 'NA') as cardgroup Resident Sample;
Load products, sales, 'cardA' as Group, Applymap('Sample', cardgroup, 'NA') as cardgroup Resident Sample;
Load products, sales, 'cardB' as Group, Applymap('Sample', cardgroup, 'NA') as cardgroup Resident Sample;
Drop Table Sample;
Hi Anil,
I created a inline table like below
load * inline [
cardgroup,Group
cardA,All
cardB,All
cardA,cardA
cardB,cardB
];
it looks working , let me if I am wrong
You said, you have thousand of hundred records, That is the case you want to do manually for whole records? If so, Not good idea. And although here you have to do some similar cases where Mapping table to each record using ApplyMap(). That may makes lot informative and structured format.
Can i know the reason you want to do this in Script only. Because, My first reply gives the good result until unless brain to storm. Here, I've done one island table to map each together
We have couple of filter conditions in ui expression already ,
that too expression are bit lengthy , are we prefer here to do in script rather than ui
Regarding 10 milimoon records is
cardGroup will be always have only cardA or cardB only
but to map 'All' flag am loading full qvd again right which I don't want to do that
let me know if u r not clear on my explination
This is the case, You can map island table to the Fact table where 10M records pulling. Will you?