Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Honored Contributor III

Category help!

Hi Folks,

I'm using below simple logic:

fact:

      LOAD

     [GuV Zeile] as Income_Statement,

     if(Match([GuV Zeile],'I - Raw material','J - Other components','K - Freight-in','L - Int. delivered mat. [Germany]','M - Discounts'),'Production Material',

    

     if(Match([GuV Zeile],'N - Direct labor'),'Direct Labour',

    

     if(Match([GuV Zeile],'P - Contract labor'),'Contract Labor',

    

     if(Match([GuV Zeile],'R - Indirect personnel','S - Temporary Ind. Employees','T - Other overhead'),'Overhead/Temp Emp',

    

     if(Match([GuV Zeile],'X - thereof all other','Y - HQ allocation [Germ. & KNA]','Z - Plant to plant charging'),'Other Operating Inc/Exp',

    

     if(Match([GuV Zeile],'F - Freight-out','G - Packaging','H - Commissions'),'Distribution',

    

     if(Match([GuV Zeile],'Q - Energy'),'Energy',

    

     if(Match([GuV Zeile],'U - Maintenance (material & outside)','V - Repair moulds/fin. Lines','W - Depreciation'),'Other Fixed Costs',

    

     if(Match([GuV Zeile],'F - Freight-out',

     'G - Packaging',

     'I - Raw material',

     'J - Other components',

     'K - Freight-in',

     'L - Int. delivered mat. [Germany]',

     'M - Discounts',

     'N - Direct labor',

     'P - Contract labor',

     'S - Temporary Ind. Employees',

     'T - Other overhead',

    'U - Maintenance (material & outside)',

    'X - thereof all other',

     'Z - Plant to plant charging'),'Total Cost'))))))))) as Cost_Type

FROM

....................

But no sure why "Total Cost" has not been displayed inside Cost_Type:

Cost.PNG

Thanks,

AS

3 Replies
Highlighted
Valued Contributor

Re: Category help!

Can you share the file PST_Version 118_23.04.2018.xlsm ?

Highlighted
Valued Contributor

Re: Category help!

Because all value of "Total Cost" category are already included in previous if(match()) conditions...

2018-05-08 11_55_27-Modifica Script [M__test.qvw_].png

Highlighted
Honored Contributor III

Re: Category help!

Yes I know that , but looking for a way to categorize them on script side, not sure if this is possible.

As they are associated with Cost , so for time being I'm calling them different expressions as combination of Cost and Income Statement.

Regards,

AS