Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

Case condition

Hi all,

I have data like attached excel.   if any side of the column have null values  i want to  get the data.

 

YYear ,

EYear,     these two fields i need to  get as one field as Year

if(YYear=Null,EYear,YYear ) as NewYear    i want to get all the data . into single filed 

either YYear is  null or  EYear  null  i want to show the data.    

Labels (2)
9 Replies
Taoufiq_Zarra

one approche

LOAD left(Yyear&EYEar,6) as NewYear, 
     left(Ymonth&Emonth,6) as NewMonth, 
     Ysales, 
     Esales, 
     [Diff Net Sales]
FROM
.\condition.xlsx
(ooxml, embedded labels, table is Sheet1);

 

 

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
soniasweety
Master
Master
Author

thanks for the input but.. i have total 34 columns 

so i want to make  17 columns   i want  if condition only 😞

 

Taoufiq_Zarra

LOAD 
     if(len(trim(Ymonth))=0,Emonth,Ymonth) as NewMonth,
      if(len(trim(Yyear))=0,EYEar,Yyear) as NewYear,
...

?

I don't know if I fully understand your requirement...

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
soniasweety
Master
Master
Author

Yeah  i dont want to trim nulls 

 

i want to show null values  in the data . 

my data looks like

Yregion , Eregion

America, Null

America, America

Null,America

Null,America

America,Null        

 

i want to get all the data  with that if condition  as one filed.

 

Taoufiq_Zarra

So from :

Yregion , Eregion

America, Null

America, America

Null,America

Null,America

America,Null

 

what is the expected output ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
soniasweety
Master
Master
Author

from this field i want to create one  field . 

 

i have two measures  -  Esale and Ysales

if i select Month, or year from the listbox    it should take the respective field . along with nulls

Taoufiq_Zarra

I'm sorry @soniasweety  , but I didn't always understand the request !

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
soniasweety
Master
Master
Author

The issue im facing is

two different column names and values are same.  

but i want to make as single field instead of keeping two seperate field s in the dashboard.

Ysales,  Esales  and    Differance  Ysales-Esales    this should match when i use the final field which we are creating as in if condition

Taoufiq_Zarra

Capture.PNG

can you give me the expected result?
display in an excel or on paint, just to illustrate your idea.

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉