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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple if/else calculations

Hey guys,

I'm new to QlikView so I hope you can help me out! I need to calculate the price index as follow:

Selected month

Previous month compared to selected month

1. If revenue nov.'16 * m³ = 0, then 0
    else revenue nov.'16 / m³ nov.'16

2. If total 2016 m³ = 0, then 0

    else if
    revenue * m³ = 0, then show the value from calculation 1

    else revenue / m³

3. If calculation 2 = 0 or when (calculation 2 - calculation 2) = 0, then 0

    else (calculation 2 - calculation 2) / calculation 2

This is followed by some extra calculations:

A. (Sumproduct all rows from calculation 1 with total 2016 m³) / total 2016 m³

B. (Sumproduct all rows from calculation 2 with total 2016 m³) / total 2016 m³

C. 100 + (calculation B / calculation A -1) * 100

D. If calculation C = 0, then 0

    else (calculation C - calculation C) / 100

This is currently all in Excel (see attachment) but I want to get it done in QlikView. Does anyone have any ideas? Many thanks in advance!

Labels (1)
2 Replies
sunny_talwar
MVP
MVP

Can you share the raw data behind this kind of output you need?

Not applicable
Author

The raw data looks like this:

Raw data.PNG

I hope it's useful!