Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Levente_Szittya
Partner - Contributor III
Partner - Contributor III

Set analysis with P() - embedded set, embedded P()

Hi All,

Could you please advise what can I do to successfully remake a set analysis on live data?

I have made a test value where a customer has 2 different accounts (for purpose) and some calculations shall be consolidated. This means that C1a and C1b shall both be counted knowing that both of them is linked to consolidated account: C1.

In my solution for my test data I have used P() values in set analysis, saying that I need to calculate certain aggregation (let's say sum of values) on a by-pass dataset, which gives back not only seleted account, but all related accounts trough the consolidated account: 

{<

Account=P(

{<

ConsAcc=P(ConsAcc)

,

Account=

>}

Account

)

>}.

This works fine with my test data. When I select C1a, by-pass set contains all accounts where consolidated account is C1 => result is C1a, C1b. The same works when I select only C1b.

In 'live' app however similar logic does not work. Data structure is not exactly the same in 'live' app and in test app (that was designed for this very purpose to get back such consolidated figures).

I only get back the selected account.

Does anyone have any idea what could go wrong in such scenario? In test data table connection is direct, while in 'live' data tabel connaction is indirect (need to go trough 2 other tables)...

Thanks and best regards,

Levente

 

1 Solution

Accepted Solutions
marcus_sommer

There are a lot of reasons possible why it worked in one app and not within another especially if the data-model is significantly different. I suggest not to try to adjust the set analysis else to create in each app a table-box with the relevant fields and then to apply various selections to detect the difference within the data-association and/or within the data-quality.

If you find differences and could deduct the causes and possible side-effects you may try to adjust the set analysis and/or also changes on the data-model. Maybe there are some more different things between your test-app and the live-app ...

- Marcus

View solution in original post

3 Replies
marcus_sommer

There are a lot of reasons possible why it worked in one app and not within another especially if the data-model is significantly different. I suggest not to try to adjust the set analysis else to create in each app a table-box with the relevant fields and then to apply various selections to detect the difference within the data-association and/or within the data-quality.

If you find differences and could deduct the causes and possible side-effects you may try to adjust the set analysis and/or also changes on the data-model. Maybe there are some more different things between your test-app and the live-app ...

- Marcus

Levente_Szittya
Partner - Contributor III
Partner - Contributor III
Author

Hi Marcus,

Thanks for your comments. I have tried to dig deeper based on your suggestions and suddenly I got a hint that helped me to locate (most probably) the issue, which is data model related.

Last, but not least I would like to ask you about something strange that I faced in Qlik during this project. Before I saw your answer I tried to split the task in live app and created a concatenation which used fields only from one table. The aim of concatenation was to display all customer codes that are linked to selected code(s) through the consolidated customer code. I had to give it up on that afternoon as even this simple task seemed to be unachievable.

Next morning when I sat down to continue working on it I saw that it was working good. I was happy and frustrated as well, because I spent a lot of time on the previous day thinking why it did not work.

Again, this time aim was only to see that I can manage to define a set, where all relevant customer codes are taken into consideration after selecting certain customer code(s), no data model issue could apply as data was in a simple table.

I know sometimes F5 shall be pressed to get proper calculation result. This time even closing the browser was tried and still I could not get proper result at the previous day's afternoon, however next morning it turned out to be working.  Why?

What can I do to prevent such bugs?

Levente

marcus_sommer

I don't think that there was a bug within Qlik which caused an inconsistent behaviour else that any data weren't properly loaded or had a bad quality. By complex projects there may dozens of working steps/reloads which may also have dependencies to each other especially in which order they were executed and each very small irregularity in between all them may cause strange and at first not very obvious effects.

So, sometimes we have just a bad day and should just forget it. If it happens more often as we would like to accept it we need to simplify the things by considering the possible efforts within the development, maintaining and administering before we start with the project. It may sound a bit silly but the smartest and most performant logic/code converts easily into a nightmare if it's requires complex logic. Therefore, like a wise man had said: keep it as simple as possible - but not simpler.

- Marcus