Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Unassociate if a specific variable exists


Hi,

I have an exception to a rule in the data that I am using and would like to unassociate 2 variables if another variable is present. Is there a way to do this?

For example, I have a ledger code and cost centre. The cost centre has a table that associates to a profit and loss heading, however, if I have a specific ledger code, I don't want the cost centre to associate with the profit and loss heading.

Any ideas gratefully received

Thanks,

Caroline

6 Replies
Not applicable
Author

Hi,

     Can you please explain where you want to check  condition with these two variables , at the time load script or in chart expression.And if you have any sample file so please attach .It will be helpful to understand.

Thanks

Ashutosh

Not applicable
Author

Hi Ashutosh,

I think it will be better if I can unassociate these variables when the script is loaded.

At the moment I have a cost centre look up table;

A General Ledger look up table;

And then my data, which looks up a category and P&L heading from the above tables;

This all works ok, except that for GL Account 324010 I don’t want the cost centre to associate with production P&L Heading from the cost centre lookup table. I need it to be shown separately if at all possible?

Thanks,

Caroline

Not applicable
Author

Hi,

     So you want that in "P&L Heading" column"only "Production" value should not show with "Cost Center" otherwise it should be show with other "P&L Heading" column values...right?

Second thing  if you are not going to show with Production with "Cost Center" so that mean you are going to use ledger code  but you din't tell anything about ledger code....can you please explain?

Thanks,

Ashutosh

Not applicable
Author

Hi,

Ideally I would like the cost centre to look up to the P&L Heading, unless the GL = 324010, then I would like the P&L heading to = Redundancy costs.

In my model, the cost centres drive the P&L headings and the GL codes drive the categories. The category that is associated with GL 324010 is redundancy costs.

I hope this is clearer?

Thanks,

Caroline

Not applicable
Author

Hi,

     yes now it is clear.If you want to change your heading according to your value then you done this in expression:

1. Add two expression in your chart

2. Write  condition in conditional option in expression tab

               if(GL = 324010 , 1, 0) 

          and give this label name as P&L Heading

3. Like that for second expression

     if(GL <> 324010 , 1, 0)

     and give label as Redunduncy Cost.

It will show accordinglly.

Or you can do this  in script but i am not sure about this.

     In Script:

     1. load those records where GL = 324010  and there give column name as "Redundancy Cost".

     2. load those record where GL <> 324010 and concatenate with first table which you created with  Redundancy cost in first point.

     3. Then in expression you can use field separately.

Try this and let me know.

Hope this helps you.

Regards,

Ashutosh

Not applicable
Author

Thanks, I’ll give that a try

Kind Regards,

Caroline