Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

If then condition Qlik Sense

Hello -

I have a simple Oracle table which I pulled into Qlik Sense. the columns are structured as below:

VERSIONMONTHAMOUNT
ACTUALJAN100
ACTUALFEB200
PLANJAN80
PLANMAR90

In Qlik Sense I am trying to use a table and create a measure for Actual as a column and one for the plan using if condition in a measure calculation. This is how I want to see it:

VERSIONMONTHACTUALPLAN
ACTUALJAN10080
ACTUALFEB2000
PLANMAR90

I am using the following calculation under 'measure' in Qlik Sense:

if (VERSION_ID='ACTUAL', Sum(AMOUNT), 0) for the Actual column and

if (VERSION_ID='PLAN', Sum(AMOUNT), 0) FOR PLAN column but

I don't get any numbers calculating. What am I missing? Please help.

Thanks!!

1 Solution

Accepted Solutions
lironbaram
Honored Contributor II

Re: If then condition Qlik Sense

first

try to change to

sum(if (VERSION_ID='ACTUAL', AMOUNT, 0) )

sum(if (VERSION_ID='PLAN', AMOUNT, 0) )



9 Replies
lironbaram
Honored Contributor II

Re: If then condition Qlik Sense

first

try to change to

sum(if (VERSION_ID='ACTUAL', AMOUNT, 0) )

sum(if (VERSION_ID='PLAN', AMOUNT, 0) )



Not applicable

Re: If then condition Qlik Sense

Thank you!!! That worked Thank you so much.

Re: If then condition Qlik Sense

Hi,

you could also use a generic load in the script to create the table you described.

hope this helps

regards

Marco

Re: If then condition Qlik Sense

In QlikView it could look like:

QlikCommunity_Thread_145658_Pic1.JPG

Generic

LOAD MONTH,

    VERSION,

    AMOUNT

FROM [http://community.qlik.com/thread/145658] (html, codepage is 1252, embedded labels, table is @1);

hope this helps

regards

Marco

Re: If then condition Qlik Sense

and in Qlik Sense:

QlikCommunity_Thread_145658_Pic1.JPG

Generic LOAD

     MONTH,

     VERSION,

     AMOUNT

FROM [lib://QlikCommunity_Thread_145658] (html, codepage is 1252, embedded labels, table is @1);

QlikCommunity_Thread_145658_Pic2.JPG

hope this helps

regards

Marco

Not applicable

Re: If then condition Qlik Sense

Marco -

This works! Thank you so much for the help.

Re: If then condition Qlik Sense

You're welcome.

If you like , you can mark helpful in case it helped you.

Thanks

Regards

Marco

Not applicable

Re: If then condition Qlik Sense

I looked to mark it helpful but can't find it. Can you please let me know how to mark the response helpful?

Thanks!!

Re: If then condition Qlik Sense

Hi,

when logged in, there should be this button available in your threads:

_Helpful.JPG

regards

Marco

Community Browser