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: 
Not applicable

Load inline - maintaining 1 dimension in 2 loads

Dear all,

I have the following issue.

I need to create a new dimension (call it "expense"), as this new dimension is nothing but the grouping of existing ones, then I chose simple load inline method. I attached a simple example where I create "expense" based on dimension called "konto".

Now, I need to include to "expense" dimension, (as "sga") as well all records, fulfilling the following conditions:

f1 = 'p1'

and

f2 = 'a1'

This is not that simple to write another load inline with f1, f2 and expense dimensions.

Can anyone help me to get the expected results?

thanks a lot in advance

Robert

4 Replies
cjohnson
Partner - Creator II
Partner - Creator II

Hi Draszor,

I'm not sure if this is the best way to do it based on your requirement, but one way that would work is if you did the following:

script.png

Use a left join and then use the following if statement. Please see attached for more detail.

What is konto = 112 and f1 = 'p1'. What would you like it to do in that scenario?

Thanks,

Camile

cjohnson
Partner - Creator II
Partner - Creator II

New field: expense

expense.png

Not applicable
Author

Thanks Camile,

This almost solves my probem....

As I understand, the "expens" dimension becomes more a technical one in such construction. I have 2 issues with this:

1. Is it a way to eliminate a need for this technical dimension in the model? Just to avoid having unnecesary dimensions created

2. I was a bit too simplistic, trying to show the problem itself, and not mentioning that in my Load Inline statement, the "expens" dimension has its further aggregates. now using your sollution those additional dimensions are not appearing at the additionally added (by NONCONCATENATE) records:

my statement is more similar to the below one:

capture_0.GIF

And now the Gr_Acc1, and GrAcc2 do not appear in case of f1='p1' and f2='a1':

Capture.GIF

Explaining more my intention, in short I want to adjut expenses coming from local accountin system, to corporate requirements. So far I was thinking it is 1 to 1 relation between what is local exense, and what is the expense for the group. However there is couple of accounts that locally are treated as OOI, but should be expenses for the group.

I don't want to resign from my local expense to group expense allocation logic (as it works fine), but, based on 2 dimensions specific ONLY to those couple of mismatching accounts, I would like to add the expense characteristic to them (meaning populate for them the "expense" dimension that is empty for all other "non-expense" accounts, but as well have further aggregares (Gr_Acc1, Gr_Acc2) wrking in their case

cjohnson
Partner - Creator II
Partner - Creator II

Hi Draszor,

I didn't have a chance to look at this until now.

To address your questions:

1. What I did in the example is I referenced the "expens" field  and then replaced it with a new "expens" field determined by the logic identified before -- so instead of having two fields you have one.

2. You will need to put separate statements for each of the fields you want to be added for f1 and f2 (as shown by what is attached). I think you will need to determine the order/hierarchy of this in order to determine what the best way to accomplish it is. For example, what is p1 = f1 and konto = 112. What would you want to occur in this case?

Please see attached for an option. You could also use applymap to get the same result -- it depends on what you are looking for.

Thanks,

Camile