Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

simple and smart ?

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

14 Replies
Anil_Babu_Samineni

One front end solution, May be this?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

Required only in Backend

Anil_Babu_Samineni

Then your way is correct only

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

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

Anil_Babu_Samineni

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;

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

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

Anil_Babu_Samineni

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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

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

Anil_Babu_Samineni

This is the case, You can map island table to the Fact table where 10M records pulling. Will you?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)