Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qsted527
Contributor
Contributor

how to use "two" if statement to create a new column?

Dear all

I am using qliksense cloud, after have loaded the data and now i am trying to create a new column( ajouter un champs calcule, in french version) not in the script .

when there is one condition, I've  used syntax like: if(Lib_type_mvt='VL',1,0) when Lib_type_mvt = 'VL', the value of new column is 1 if not is 0. It works for the only one condition. but when there is two conditions like if(Lib_type_mvt= 'VL' or Lib_type_mvt='VC',1,0)

it doesn't work!IMG_0294.JPG

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Can you try this?

= if(Match(Lib_type_mvt, 'VL, 'VC')>0,1,0)

View solution in original post

5 Replies
qsted527
Contributor
Contributor
Author

Could anyone help me?

Thanks a lot.

Je vous remercie par avance.

quriouss
Creator III
Creator III

What error are you getting? Just that "Aucun aperçu"?

You're adding it as a measure (champs calcule) correct? In that case I think you might need to have some sort of aggregation to get a sensible result,


SUM (if(Lib_type_mvt= 'VL' or Lib_type_mvt='VC',1,0))


vishsaggi
Champion III
Champion III

Can you try this?

= if(Match(Lib_type_mvt, 'VL, 'VC')>0,1,0)

View solution in original post

qsted527
Contributor
Contributor
Author

Hi

I have  tried SUM() and count() only () yesterday it doesn't work either.

Shuo

qsted527
Contributor
Contributor
Author

Hi

That is great! it works,  thank you so much for your help and also many thanks to simon.

Shuo