Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

swethasmilek
New Contributor

How to Diiferentiate same Dimensions with out Concatenate and to create Flags

I have two sources which are having same columns across dimensions and measures are same. But I need not to concatenate two sources because of some particular Region.

I have a Requirement to show charts in each individual sheet of source. Let say I have Source A need to have one Flag and Source B with another Flag.In this way is there any chance to avoid Synthetic Keys?

2)In Front End to differentiate Sources to call Flag in Set Analysis its always a problem takes time.Is there any way to call Flag and use Select in Field to differentiate two sheets and there shouldn’t be any Associations between two sheet objects

6 Replies

Re: How to Diiferentiate same Dimensions with out Concatenate and to create Flags

Can your prepare sample data of only 5-10 lines?

richbyard
New Contributor III

Re: How to Diiferentiate same Dimensions with out Concatenate and to create Flags

You could alias the field in the script, for example

LOAD

     CustomerName as CustomerName2

FROM...

so that you have two distinct fields for each source.

You also have an option to use the QUALIFY *; function in the script which will put the source table name in front of each field name (see extract from help menu below). Be sure to unqualify the fields that are common between the two datasets.

In an unfamiliar database, it is often useful to start out by making sure that only one or a few fields are associated, as illustrated in this example:

qualify *;

unqualify TransID;

select * from tab1;

select * from tab2;

select * from tab3;

Only TransID will be used for associations between the tables tab1, tab2 and tab3.

Hope this helps.

Re: How to Diiferentiate same Dimensions with out Concatenate and to create Flags

I may have misread tyour explanation, but maybe these remarks may help you in solving your problem.

Select in Field does what it says. It selects a value in a field of the data model, and all UI objects will be affected.

If the two sources reside in the same table, you can separate their values in the UI by using an additional table field and set analysis. In your LOAD script, add a new column assignment like ...'Source1' AS Flag, ...to the first table LOAD, and ... 'Source2' AS Flag, ... to the second table load. Then add this set analysis specification to all expressions that should show data from set Source1 only:


...{<Flag={'Source1'}>}...


Add a comparable set specification to the expressions of your second chart, but now with value 'Source2'.


As an alternative, and if you really want to keep the internal tables separate at all times, you can rename all fields when loading data from the second source in a different table. However selections in listboxes will only operate on one of the two charts...


Best,


Peter

swethasmilek
New Contributor

Re: How to Diiferentiate same Dimensions with out Concatenate and to create Flags

Peter,can you explain in detail as i am not able to getting exactly.Here are below columns which are similar across two sources.Need not to concatenate sources and

How can we Show a Flag to differentiate sources?

In front End how to show charts in two sheets each source for one sheet?How can we add Sum aggr functions with out writting <Flag 1={'Source A'}> IN Field ti set in Sheets to differentiate two shhets with no associations Across Objects

 

Region
Sub Region
Sub master
Curr

Rep

Office

Number
Outstand
Inbound
buzzy996
Honored Contributor II

Re: How to Diiferentiate same Dimensions with out Concatenate and to create Flags

hopes,

no concatenate will helps to keep both the tables individually,there is no question of synthetic keys if u use this.

swethasmilek
New Contributor

Re: How to Diiferentiate same Dimensions with out Concatenate and to create Flags

Sorry i mean to differentiate sources need not to use concatenation.If i do so suppose i need to show sum(Outstand Amount) for Each Region in this case i am not getting Desire Outputs because two sources are concatenated and getting Results

How to Add Flags?

How to write Expressions for all QV Objects to differentiate Two Sources?

Community Browser