Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to separet from the if function?

Hi All:

I am having this script:

if (prodid = '260080','Big Crate','Small Crate') as Crate_ID,

When I select the Crare_ID it will show Big Crate and also Small Crate.

But now I just want it to shows only Big crate and Small Crate separately.

Example:-

Crate_ID it shows Big Crate and Small Crate.

Now I want it to show:

Only Big Crate

Only Small Crate

I try using:

Prodid = “260080” as Big Crate in the script but when I try to select in the selected table it shows -1 and 0.

Example:-

Big_Crate showing -1 and 0

Have not try the small crate yet...

Not sure where I go wrong.

Can anyone please share some light?

Thanks

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Create two fields in the script like:

if (prodid = '260080','Big Crate') as [Big Crate],

if (prodid <> '260080','Small Crate') as [Small Crate]

Then you can use one or the other field as a dimension.

-Rob

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Create two fields in the script like:

if (prodid = '260080','Big Crate') as [Big Crate],

if (prodid <> '260080','Small Crate') as [Small Crate]

Then you can use one or the other field as a dimension.

-Rob

Not applicable
Author

Hi Rob:

Thanks got it.

You are a great help

Cheers

Richard