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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to write expression to add column into table

Hi,

I have expression as below.

when I am using this it is showing error as Error in expression:If takes 2-3 parameters

If(MixMatch(Zinc,'Present',

        IF (MixMatch( Coal,'Marbel Transfer'),'Ready',

            If(MixMatch(Zinc,'XX','YY','CC','SS','VV'),'Ready',

              If(MixMatch(Coal,'NOTXX','NOTYY','NOTSS','NOTCC','NOTZZ',

                  If (Not Match(Coal,'Marbel Transfer'),'Ready')))))))) as [Ready],

Please can anyone suggest me how to set this?

Thanks.

21 Replies
Not applicable
Author

Thanks.  I have used this by making change by considering your previous one. when I used this the column  'Zinc' is showing only value 'Present' and the column 'Zinc' is not showing values 'XX', 'YY', 'CC', 'SS', 'VV'

Please let me know do I need to change anything here?

sunny_talwar

I didn't understand? Do you want to change the conditions???

Not applicable
Author

Please see attached. Zinc list box is showing only value 'Present' but I need Zinc list box should show

Present, ,'XX','YY','CC','SS','VV'

EDIT: I don't want to change the conditions. when I used table box. all columns are fine but Zinc column is showing values only 'Present'.

sunny_talwar

But we are not making any changes to Zinc. This is your database/data issue. I am helping you create a new column Ready which only uses what you have in Zinc. Does that make sense?

Sunny

Not applicable
Author

yes it makes sense. data is populating into Ready except wherever in source data Zinc= NOTZZ and Coal <> 'Marbel Transfer'

Is it again data problem?

why I am asking is data is populating fine wherever there is

Zinc, 'NOTXX','NOTYY','NOTSS','NOTCC') and Coal <> 'Marbel Transfer'

please let me know

sunny_talwar

Oh so you mean that it doesn't show NotReady when Zinc is NOTZZ and Coal <> 'Marbel Transfer'?

That is strange, would you be able to share a sample application to check this?

Not applicable
Author

sorry I should have add one more to the condition. so, I need to show

NotReady when Zinc is Present and Coal <> 'Marbel Transfer'?

If((Zinc = 'Present' and Coal = 'Marbel Transfer') or (MixMatch(Zinc, 'XX', 'YY', 'CC', 'SS', 'VV')), 'Ready',

If(MixMatch(Zinc, 'NOTXX','NOTYY','NOTSS','NOTCC','NOTZZ','Present') and Coal <> 'Marbel Transfer', 'NotReady')) as Ready

sunny_talwar

Try this:


If((Zinc = 'Present' and Coal = 'Marbel Transfer') or (MixMatch(Zinc, 'XX', 'YY', 'CC', 'SS', 'VV')), 'Ready',

If(MixMatch(Zinc, 'NOTXX','NOTYY','NOTSS','NOTCC','NOTZZ', 'Present') and Coal <> 'Marbel Transfer', 'NotReady')) as Ready

Not applicable
Author

Thanks. Tried this. still not populating data into Ready. do we need to use any TRIM functions. I checked excel file as well everything is fine.

sunny_talwar

One issue I see in the qvw you have attached is that the Coal column is almost empty

If.PNG

Is the goal is to fill NotReady everywhere we don't have Ready in column Ready? If that is the goal you can probably use this:

If((Zinc = 'Present' and Coal = 'Marbel Transfer') or (MixMatch(Zinc, 'XX', 'YY', 'CC', 'SS', 'VV')), 'Ready', 'NotReady')) as Ready