Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Abhishek1
New Contributor III

Set Analysis

Hi All,

I have written an expression as Follows:

Sum({$<[Allocation Status]={'Non Self Serve'}, [Hierarchy Level 1] = {'Business'},[Document Number] = P({$<[Hierarchy Level 4],[Hierarchy Level 3],[Hierarchy Level 2]>}[Document Number])>}
Interval(([Approval Date]) - ([First Notification (UTC)]),'D'))

 

This expression is suppose to give me the sum of the interval Where Hierarchy Level 1 ='Business' and also in case a different hierarchy is selected, then IT will show the sum of interval for all the Document numbers that are common between Hierarchy level 1 = 'Business' and that selection.

This works fine, untill I make a selection. Suppose I select a hierarchy level 2, then the values OF Text boxes showing Hierarchy level 1 data becomes '0'. while the data for Hieararchy level 2, Hierarchy level 3 and 4 are showing correct.

Similarly when  I select a hierarchy level 3, then the values OF Text boxes showing Hierarchy level 1 and Hierarchy level 2 data becomes '0'. while the data for Hieararchy level 3, Hierarchy level 4  are showing correct. and so on.

Can anyone help me with this?

 

Labels (1)
3 Replies
MVP
MVP

Re: Set Analysis

Abhisehk,

Are these hierarchies part of same hierarchy? I suspect that your p() might not be required or  not used appropriately. Could you share a sample and explain expected behavior/output there?

Abhishek1
New Contributor III

Re: Set Analysis

Hi Tresesco,

These hierarchies are different fields of the same table. There are four hierarchies, Hierarchy Level 1,2,3,4. There are hierarchies in which are not depended on one another, but enen then these have Document numbers that fall uner each of them most of the times. I am trying to create a \sample data. will update once it is done. It is a bit difficult.

 

Support
Support

Re: Set Analysis

Not sure if this is really of any help or not, but wanted to drop it in here just in case:

https://community.qlik.com/t5/Qlik-Design-Blog/Unbalanced-n-level-hierarchies/ba-p/1474325

Regards,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.